From 3dca79c49fe09fe1893fa4b52c3c6ec5c2297ba3 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 21 Mar 2012 00:12:16 +0100 Subject: [PATCH] Fix map creation error --- .../net/osmand/data/preparation/BinaryMapIndexWriter.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DataExtractionOSM/src/net/osmand/data/preparation/BinaryMapIndexWriter.java b/DataExtractionOSM/src/net/osmand/data/preparation/BinaryMapIndexWriter.java index d0daa7c277..f57534cc4c 100644 --- a/DataExtractionOSM/src/net/osmand/data/preparation/BinaryMapIndexWriter.java +++ b/DataExtractionOSM/src/net/osmand/data/preparation/BinaryMapIndexWriter.java @@ -358,8 +358,8 @@ public class BinaryMapIndexWriter { int tx = (x - pcalcx) >> SHIFT_COORDINATES; int ty = (y - pcalcy) >> SHIFT_COORDINATES; - writeRawVarint32(mapDataBuf, tx); - writeRawVarint32(mapDataBuf, ty); + writeRawVarint32(mapDataBuf, CodedOutputStream.encodeZigZag32(tx)); + writeRawVarint32(mapDataBuf, CodedOutputStream.encodeZigZag32(ty)); pcalcx = pcalcx + (tx << SHIFT_COORDINATES); pcalcy = pcalcy + (ty << SHIFT_COORDINATES); @@ -390,8 +390,8 @@ public class BinaryMapIndexWriter { int tx = (x - pcalcx) >> SHIFT_COORDINATES; int ty = (y - pcalcy) >> SHIFT_COORDINATES; - writeRawVarint32(mapDataBuf, tx); - writeRawVarint32(mapDataBuf, ty); + writeRawVarint32(mapDataBuf, CodedOutputStream.encodeZigZag32(tx)); + writeRawVarint32(mapDataBuf, CodedOutputStream.encodeZigZag32(ty)); pcalcx = pcalcx + (tx << SHIFT_COORDINATES); pcalcy = pcalcy + (ty << SHIFT_COORDINATES);