Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2017-09-03 01:31:40 +02:00
commit 31cad3019f
3 changed files with 29 additions and 13 deletions

View file

@ -74,15 +74,16 @@ public class BinaryInspector {
in.inspector(new String[] { in.inspector(new String[] {
// "-vpoi", // "-vpoi",
"-vmap", "-vmapobjects", // "-vmapcoordinates", // "-vmap", "-vmapobjects",
// "-vrouting", "-vmapcoordinates",
"-vrouting",
// "-vtransport", // "-vtransport",
// "-vaddress", "-vcities","-vstreetgroups", // "-vaddress", "-vcities","-vstreetgroups",
// "-vstreets", "-vbuildings", "-vintersections", // "-vstreets", "-vbuildings", "-vintersections",
// "-lang=ru", // "-lang=ru",
// "-bbox=30.4981,50.4424,30.5195,50.4351", // "-bbox=30.4981,50.4424,30.5195,50.4351",
// "-osm="+System.getProperty("maps.dir")+"/map_full.obf.osm", // "-osm="+System.getProperty("maps.dir")+"/map_full.obf.osm",
System.getProperty("maps.dir")+"/diff/2017_08_28_01_00.obf" System.getProperty("maps.dir")+"/diff/17_08_29_22_00.diff.obf"
// System.getProperty("maps.dir")+"../temp/kiev/Ukraine_kiev-city_europe_17_06_05.obf", // System.getProperty("maps.dir")+"../temp/kiev/Ukraine_kiev-city_europe_17_06_05.obf",
// System.getProperty("maps.dir")+"Ukraine_kiev-city_europe_2.obf", // System.getProperty("maps.dir")+"Ukraine_kiev-city_europe_2.obf",
}); });
@ -923,7 +924,7 @@ public class BinaryInspector {
} }
private static void printMapDetails(BinaryMapDataObject obj, StringBuilder b, boolean vmapCoordinates) { public static void printMapDetails(BinaryMapDataObject obj, StringBuilder b, boolean vmapCoordinates) {
boolean multipolygon = obj.getPolygonInnerCoordinates() != null && obj.getPolygonInnerCoordinates().length > 0; boolean multipolygon = obj.getPolygonInnerCoordinates() != null && obj.getPolygonInnerCoordinates().length > 0;
if (multipolygon) { if (multipolygon) {
b.append("Multipolygon"); b.append("Multipolygon");

View file

@ -200,7 +200,6 @@ public class BinaryMapDataObject {
if(this.objectType == thatObj.objectType if(this.objectType == thatObj.objectType
&& this.id == thatObj.id && this.id == thatObj.id
&& this.area == thatObj.area && this.area == thatObj.area
&& Arrays.equals(this.polygonInnerCoordinates, thatObj.polygonInnerCoordinates)
&& Arrays.equals(this.coordinates, thatObj.coordinates) ) { && Arrays.equals(this.coordinates, thatObj.coordinates) ) {
if(mapIndex == null) { if(mapIndex == null) {
throw new IllegalStateException("Illegal binary object: " + id); throw new IllegalStateException("Illegal binary object: " + id);
@ -208,7 +207,26 @@ public class BinaryMapDataObject {
if(thatObj.mapIndex == null) { if(thatObj.mapIndex == null) {
throw new IllegalStateException("Illegal binary object: " + thatObj.id); throw new IllegalStateException("Illegal binary object: " + thatObj.id);
} }
boolean equals = true; boolean equals = true;
if(equals) {
if(polygonInnerCoordinates == null || thatObj.polygonInnerCoordinates == null) {
equals = polygonInnerCoordinates == thatObj.polygonInnerCoordinates;
} else if(polygonInnerCoordinates.length != thatObj.polygonInnerCoordinates.length){
equals = false;
} else {
for(int i = 0; i < polygonInnerCoordinates.length && equals; i++) {
if(polygonInnerCoordinates[i] == null || thatObj.polygonInnerCoordinates[i] == null) {
equals = polygonInnerCoordinates[i] == thatObj.polygonInnerCoordinates[i];
} else if(polygonInnerCoordinates[i].length != thatObj.polygonInnerCoordinates[i].length){
equals = false;
} else {
equals = Arrays.equals(polygonInnerCoordinates[i], thatObj.polygonInnerCoordinates[i]);
}
}
}
}
if(equals) { if(equals) {
if(types == null || thatObj.types == null) { if(types == null || thatObj.types == null) {
equals = types == thatObj.types; equals = types == thatObj.types;
@ -218,7 +236,7 @@ public class BinaryMapDataObject {
for(int i = 0; i < types.length && equals; i++) { for(int i = 0; i < types.length && equals; i++) {
TagValuePair o = mapIndex.decodeType(types[i]); TagValuePair o = mapIndex.decodeType(types[i]);
TagValuePair s = thatObj.mapIndex.decodeType(thatObj.types[i]); TagValuePair s = thatObj.mapIndex.decodeType(thatObj.types[i]);
equals = o.equals(s); equals = o.equals(s) && equals;
} }
} }
} }
@ -265,7 +283,8 @@ public class BinaryMapDataObject {
return equals; return equals;
} }
// thatObj.mapIndex.decodeType(thatObj.types[0])
// mapIndex.decodeType(types[0]) id >>7
return false; return false;
} }

View file

@ -77,11 +77,7 @@ public class RouteDataObject {
boolean equals = true; boolean equals = true;
equals = equals && Arrays.equals(this.restrictions, thatObj.restrictions); equals = equals && Arrays.equals(this.restrictions, thatObj.restrictions);
if (equals) {
if (this.names != null && thatObj.names != null) {
equals = Arrays.equals(this.names.values(), thatObj.names.values());
}
}
if (equals) { if (equals) {
if (this.types == null || thatObj.types == null) { if (this.types == null || thatObj.types == null) {
equals = this.types == thatObj.types; equals = this.types == thatObj.types;
@ -158,7 +154,7 @@ public class RouteDataObject {
} }
} }
} }
return equals;
} }
return false; return false;
} }