Fix initialization problem

This commit is contained in:
Victor Shcherb 2012-06-18 22:42:34 +02:00
parent 002f86d657
commit d87ec826c8
5 changed files with 9 additions and 5 deletions

View file

@ -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
}

View file

@ -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);

View file

@ -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();

View file

@ -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:

View file

@ -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: {