Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2016-05-07 17:58:52 +02:00
commit be4171ecda
6 changed files with 56 additions and 1 deletions

View file

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

View file

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

View file

@ -82,6 +82,7 @@ public class BinaryMapIndexReader {
private final static Log log = PlatformUtil.getLog(BinaryMapIndexReader.class);
public static boolean READ_STATS = false;
private final RandomAccessFile raf;
protected final File file;
/*private*/ int version;
@ -1827,6 +1828,14 @@ public class BinaryMapIndexReader {
public boolean isBaseMap(){
return name != null && name.toLowerCase().contains(BASEMAP_NAME);
}
public String getPartName() {
return "Map";
}
public int getFieldNumber() {
return OsmandOdb.OsmAndStructure.MAPINDEX_FIELD_NUMBER;
}
}
public static class TagValuePair {

View file

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

View file

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

View file

@ -42,6 +42,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;
}