Fix binary writer
This commit is contained in:
parent
c2f91aac3a
commit
56aaffd57f
1 changed files with 10 additions and 3 deletions
|
@ -353,7 +353,8 @@ public class BinaryMapIndexWriter {
|
|||
private TByteArrayList mapDataBuf = new TByteArrayList();
|
||||
|
||||
public MapData writeMapData(long diffId, int pleft, int ptop, boolean area, byte[] coordinates, byte[] innerPolygonTypes, int[] typeUse,
|
||||
int[] addtypeUse, Map<MapRulType, String> names, Map<String, Integer> stringTable, MapDataBlock.Builder dataBlock)
|
||||
int[] addtypeUse, Map<MapRulType, String> names, Map<String, Integer> stringTable, MapDataBlock.Builder dataBlock,
|
||||
boolean allowCoordinateSimplification)
|
||||
throws IOException {
|
||||
|
||||
MapData.Builder data = MapData.newBuilder();
|
||||
|
@ -372,8 +373,11 @@ public class BinaryMapIndexWriter {
|
|||
writeRawVarint32(mapDataBuf, CodedOutputStream.encodeZigZag32(ty));
|
||||
pcalcx = pcalcx + tx ;
|
||||
pcalcy = pcalcy + ty ;
|
||||
delta = 1;
|
||||
if (allowCoordinateSimplification) {
|
||||
delta = skipSomeNodes(coordinates, len, i, x, y, false);
|
||||
}
|
||||
}
|
||||
COORDINATES_SIZE += CodedOutputStream.computeRawVarint32Size(mapDataBuf.size())
|
||||
+ CodedOutputStream.computeTagSize(MapData.COORDINATES_FIELD_NUMBER) + mapDataBuf.size();
|
||||
if (area) {
|
||||
|
@ -406,7 +410,10 @@ public class BinaryMapIndexWriter {
|
|||
|
||||
pcalcx = pcalcx + tx ;
|
||||
pcalcy = pcalcy + ty ;
|
||||
delta = skipSomeNodes(innerPolygonTypes, len, i, x, y ,true);
|
||||
delta = 1;
|
||||
if (allowCoordinateSimplification) {
|
||||
delta = skipSomeNodes(innerPolygonTypes, len, i, x, y, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue