diff --git a/DataExtractionOSM/src/net/osmand/binary/BinaryInspector.java b/DataExtractionOSM/src/net/osmand/binary/BinaryInspector.java index fdda236bf4..2e8afcdd2c 100644 --- a/DataExtractionOSM/src/net/osmand/binary/BinaryInspector.java +++ b/DataExtractionOSM/src/net/osmand/binary/BinaryInspector.java @@ -49,7 +49,7 @@ public class BinaryInspector { // test cases show info -// inspector(new String[]{/*"-vmap", "-bbox=-121.785,37.35,-121.744,37.33", */"/home/victor/projects/OsmAnd/data/temp/Belgium_europe_2.obf"}); +// inspector(new String[]{/*"-vmap", "-bbox=-121.785,37.35,-121.744,37.33", */"/home/victor/projects/OsmAnd/data/osm-gen/Netherlands_europe.obf"}); // test case extract parts // test case } diff --git a/DataExtractionOSM/src/net/osmand/binary/BinaryMapAddressReaderAdapter.java b/DataExtractionOSM/src/net/osmand/binary/BinaryMapAddressReaderAdapter.java index ed903e6ea7..1dc0f5ab5e 100644 --- a/DataExtractionOSM/src/net/osmand/binary/BinaryMapAddressReaderAdapter.java +++ b/DataExtractionOSM/src/net/osmand/binary/BinaryMapAddressReaderAdapter.java @@ -498,7 +498,6 @@ public class BinaryMapAddressReaderAdapter { codedIS.popLimit(old); } if (obj != null) { - System.out.println("STREET " + list.get(j) ); codedIS.seek(list.get(j)); int len = codedIS.readRawVarint32(); int old = codedIS.pushLimit(len); diff --git a/DataExtractionOSM/src/net/osmand/binary/BinaryMapIndexReader.java b/DataExtractionOSM/src/net/osmand/binary/BinaryMapIndexReader.java index 69db08a6b3..117d71c070 100644 --- a/DataExtractionOSM/src/net/osmand/binary/BinaryMapIndexReader.java +++ b/DataExtractionOSM/src/net/osmand/binary/BinaryMapIndexReader.java @@ -155,7 +155,6 @@ public class BinaryMapIndexReader { indexes.add(mapIndex); break; case OsmandOdb.OsmAndStructure.ADDRESSINDEX_FIELD_NUMBER: - AddressRegion region = new AddressRegion(); region.length = readInt(); region.filePointer = codedIS.getTotalBytesRead(); diff --git a/DataExtractionOSM/src/net/osmand/binary/BinaryMapRouteReaderAdapter.java b/DataExtractionOSM/src/net/osmand/binary/BinaryMapRouteReaderAdapter.java index 1632c0843f..64c7476fe6 100644 --- a/DataExtractionOSM/src/net/osmand/binary/BinaryMapRouteReaderAdapter.java +++ b/DataExtractionOSM/src/net/osmand/binary/BinaryMapRouteReaderAdapter.java @@ -250,12 +250,15 @@ public class BinaryMapRouteReaderAdapter { int oldLimit = codedIS.pushLimit(subregion.length); readRouteTree(subregion, null, 0, true); region.getSubregions().add(subregion); + codedIS.skipRawBytes(codedIS.getBytesUntilLimit()); codedIS.popLimit(oldLimit); - codedIS.seek(subregion.filePointer + subregion.length); + region.bottomLatitude = MapUtils.get31LatitudeY(subregion.bottom); region.topLatitude = MapUtils.get31LatitudeY(subregion.top); region.rightLongitude = MapUtils.get31LongitudeX(subregion.right); region.leftLongitude = MapUtils.get31LongitudeX(subregion.left); + // Finish reading file! + codedIS.skipRawBytes(codedIS.getBytesUntilLimit()); } break; default: @@ -527,7 +530,8 @@ public class BinaryMapRouteReaderAdapter { codedIS.popLimit(oldLimit); codedIS.seek(subregion.filePointer + subregion.length); } else { - skipUnknownField(t); + codedIS.seek(thisTree.filePointer + thisTree.length); + // skipUnknownField(t); } break; default: diff --git a/Osmand-kernel/osmand/src/binaryRead.cpp b/Osmand-kernel/osmand/src/binaryRead.cpp index 92210a740b..a4c1425e41 100644 --- a/Osmand-kernel/osmand/src/binaryRead.cpp +++ b/Osmand-kernel/osmand/src/binaryRead.cpp @@ -327,6 +327,8 @@ bool readRoutingIndex(CodedInputStream* input, RoutingIndex* routingIndex) { input->PopLimit(oldLimit); input->Seek(subregion.filePointer + subregion.length); routingIndex->subregions.push_back(subregion); + // Finish reading + input->Seek(routingIndex->filePointer + routingIndex->length); break; } default: {