BinaryInspector: add -lang flag

This commit is contained in:
Roman Inflianskas 2016-05-17 11:20:39 +03:00
parent 7997cfd234
commit 9f5ef58e0d

View file

@ -123,6 +123,7 @@ public class BinaryInspector {
double latbottom = -85;
double lonleft = -180;
double lonright = 180;
String lang = null;
int zoom = -1;
public boolean isVaddress() {
@ -186,6 +187,8 @@ public class BinaryInspector {
}
} else if (params[i].equals("-vtransport")) {
vtransport = true;
} else if (params[i].startsWith("-lang=")) {
lang = params[i].substring("-lang=".length());
} else if (params[i].startsWith("-zoom=")) {
zoom = Integer.parseInt(params[i].substring("-zoom=".length()));
} else if (params[i].startsWith("-bbox=")) {
@ -614,10 +617,8 @@ public class BinaryInspector {
BinaryMapAddressReaderAdapter.VILLAGES_TYPE,
BinaryMapAddressReaderAdapter.POSTCODES_TYPE
};
String lang = "en";
for (int j = 0; j < cityType.length; j++) {
int type = cityType[j];
for (int j = 0; j < BinaryMapAddressReaderAdapter.CITY_TYPES.length; j++) {
int type = BinaryMapAddressReaderAdapter.CITY_TYPES[j];
final List<City> cities = index.getCities(region, null, type);
print(MessageFormat.format("\t{0}, {1,number,#} group(s)", new Object[]{cityType_String[j], cities.size()}));
@ -636,8 +637,8 @@ public class BinaryInspector {
int size = index.preloadStreets(c, null);
List<Street> streets = new ArrayList<Street>(c.getStreets());
String cityDescription = (j == BinaryMapAddressReaderAdapter.POSTCODES_TYPE ?
MessageFormat.format("\t\t''{0}'' {1,number,#} street(s) size {2,number,#} bytes", c.getName(lang), streets.size(), size) :
MessageFormat.format("\t\t''{0}'' [{1,number,#}], {2,number,#} street(s) size {3,number,#} bytes", c.getName(lang), c.getId(), streets.size(), size));
MessageFormat.format("\t\t''{0}'' {1,number,#} street(s) size {2,number,#} bytes", c.getName(verbose.lang), streets.size(), size) :
MessageFormat.format("\t\t''{0}'' [{1,number,#}], {2,number,#} street(s) size {3,number,#} bytes", c.getName(verbose.lang), c.getId(), streets.size(), size));
print(cityDescription);
if (!verbose.vstreets) {
println("");
@ -656,7 +657,6 @@ public class BinaryInspector {
println(MessageFormat.format("\t\t\t''{0}'' [{1,number,#}], {2,number,#} building(s), {3,number,#} intersections(s)",
new Object[]{t.getName(lang), t.getId(), buildings.size(), intersections.size()}));
if (buildings != null && !buildings.isEmpty() && verbose.vbuildings) {
println("\t\t\t\tBuildings:");
for (Building b : buildings) {
@ -668,7 +668,7 @@ public class BinaryInspector {
if (intersections != null && !intersections.isEmpty() && verbose.vintersections) {
print("\t\t\t\tIntersects with:");
for (Street s : intersections) {
println("\t\t\t\t\t" + s.getName(lang));
println("\t\t\t\t\t" + s.getName(verbose.lang));
}
}
}