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