diff --git a/OsmAnd-java/src/net/osmand/binary/BinaryIndexPart.java b/OsmAnd-java/src/net/osmand/binary/BinaryIndexPart.java index 361a8fb92d..36cd398d7a 100644 --- a/OsmAnd-java/src/net/osmand/binary/BinaryIndexPart.java +++ b/OsmAnd-java/src/net/osmand/binary/BinaryIndexPart.java @@ -1,11 +1,15 @@ package net.osmand.binary; -public class BinaryIndexPart { +public abstract class BinaryIndexPart { String name; int length; int filePointer; + abstract public String getPartName(); + + abstract public int getFieldNumber(); + public int getLength() { return length; } diff --git a/OsmAnd-java/src/net/osmand/binary/BinaryMapAddressReaderAdapter.java b/OsmAnd-java/src/net/osmand/binary/BinaryMapAddressReaderAdapter.java index 2805f8d5d0..231b2d50fc 100644 --- a/OsmAnd-java/src/net/osmand/binary/BinaryMapAddressReaderAdapter.java +++ b/OsmAnd-java/src/net/osmand/binary/BinaryMapAddressReaderAdapter.java @@ -39,6 +39,8 @@ public class BinaryMapAddressReaderAdapter { public final static int STREET_TYPE = 4; private static final Log LOG = PlatformUtil.getLog(BinaryMapAddressReaderAdapter.class); + public final static int[] TYPES = { CITY_TOWN_TYPE, POSTCODES_TYPE, VILLAGES_TYPE, STREET_TYPE }; + public final static int[] CITY_TYPES = { CITY_TOWN_TYPE, POSTCODES_TYPE, VILLAGES_TYPE }; public static class AddressRegion extends BinaryIndexPart { String enName; @@ -63,10 +65,27 @@ public class BinaryMapAddressReaderAdapter { public int getIndexNameOffset() { return indexNameOffset; } + + + public String getPartName() { + return "Address"; + } + + public int getFieldNumber() { + return OsmandOdb.OsmAndStructure.ADDRESSINDEX_FIELD_NUMBER; + } } public static class CitiesBlock extends BinaryIndexPart { int type; + + public String getPartName() { + return "City"; + } + + public int getFieldNumber() { + return OsmandOdb.OsmAndAddressIndex.CITIES_FIELD_NUMBER; + } } private CodedInputStream codedIS; diff --git a/OsmAnd-java/src/net/osmand/binary/BinaryMapIndexReader.java b/OsmAnd-java/src/net/osmand/binary/BinaryMapIndexReader.java index 32e50fff77..feea3b9059 100644 --- a/OsmAnd-java/src/net/osmand/binary/BinaryMapIndexReader.java +++ b/OsmAnd-java/src/net/osmand/binary/BinaryMapIndexReader.java @@ -82,6 +82,10 @@ public class BinaryMapIndexReader { private final static Log log = PlatformUtil.getLog(BinaryMapIndexReader.class); public static boolean READ_STATS = false; + public final static int[] TYPES = { CITY_TOWN_TYPE, POSTCODES_TYPE, VILLAGES_TYPE, STREET_TYPE }; + public final static int[] CITY_TYPES = { CITY_TOWN_TYPE, POSTCODES_TYPE, VILLAGES_TYPE }; + + private final RandomAccessFile raf; protected final File file; /*private*/ int version; diff --git a/OsmAnd-java/src/net/osmand/binary/BinaryMapPoiReaderAdapter.java b/OsmAnd-java/src/net/osmand/binary/BinaryMapPoiReaderAdapter.java index afdc1c697e..baeb1bd937 100644 --- a/OsmAnd-java/src/net/osmand/binary/BinaryMapPoiReaderAdapter.java +++ b/OsmAnd-java/src/net/osmand/binary/BinaryMapPoiReaderAdapter.java @@ -65,6 +65,14 @@ public class BinaryMapPoiReaderAdapter { return leftLongitude; } + public String getPartName() { + return "POI"; + } + + public int getFieldNumber() { + return OsmandOdb.OsmAndStructure.POIINDEX_FIELD_NUMBER; + } + public PoiSubType getSubtypeFromId(int id, StringBuilder returnValue) { int tl; int sl; diff --git a/OsmAnd-java/src/net/osmand/binary/BinaryMapRouteReaderAdapter.java b/OsmAnd-java/src/net/osmand/binary/BinaryMapRouteReaderAdapter.java index 902dd7e7d9..031407e088 100644 --- a/OsmAnd-java/src/net/osmand/binary/BinaryMapRouteReaderAdapter.java +++ b/OsmAnd-java/src/net/osmand/binary/BinaryMapRouteReaderAdapter.java @@ -215,6 +215,13 @@ public class BinaryMapRouteReaderAdapter { int destinationTypeRule = -1; int destinationRefTypeRule = -1; + public String getPartName() { + return "Routing"; + } + + public int getFieldNumber() { + return OsmandOdb.OsmAndStructure.ROUTINGINDEX_FIELD_NUMBER; + } public RouteTypeRule quickGetEncodingRule(int id) { return routeEncodingRules.get(id); diff --git a/OsmAnd-java/src/net/osmand/binary/BinaryMapTransportReaderAdapter.java b/OsmAnd-java/src/net/osmand/binary/BinaryMapTransportReaderAdapter.java index 38a447ce59..63751e04f3 100644 --- a/OsmAnd-java/src/net/osmand/binary/BinaryMapTransportReaderAdapter.java +++ b/OsmAnd-java/src/net/osmand/binary/BinaryMapTransportReaderAdapter.java @@ -41,6 +41,14 @@ public class BinaryMapTransportReaderAdapter { int stopsFileOffset = 0; int stopsFileLength = 0; + + public String getPartName() { + return "Transport"; + } + + public int getFieldNumber() { + return OsmandOdb.OsmAndStructure.TRANSPORTINDEX_FIELD_NUMBER; + } public int getLeft() { return left;