Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2017-08-29 22:01:43 +02:00
commit 576c993f47
3 changed files with 19 additions and 9 deletions

View file

@ -81,8 +81,8 @@ public class BinaryInspector {
// "-vstreets", "-vbuildings", "-vintersections",
// "-lang=ru",
// "-bbox=30.4981,50.4424,30.5195,50.4351",
"-osm="+System.getProperty("maps.dir")+"/map_full.obf.osm",
System.getProperty("maps.dir")+"/2017_08_24_15_00.obf"
// "-osm="+System.getProperty("maps.dir")+"/map_full.obf.osm",
System.getProperty("maps.dir")+"/diff/2017_08_28_01_00.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",
});

View file

@ -202,6 +202,12 @@ public class BinaryMapDataObject {
&& this.area == thatObj.area
&& Arrays.equals(this.polygonInnerCoordinates, thatObj.polygonInnerCoordinates)
&& Arrays.equals(this.coordinates, thatObj.coordinates) ) {
if(mapIndex == null) {
throw new IllegalStateException("Illegal binary object: " + id);
}
if(thatObj.mapIndex == null) {
throw new IllegalStateException("Illegal binary object: " + thatObj.id);
}
boolean equals = true;
if(equals) {
if(types == null || thatObj.types == null) {

View file

@ -1735,6 +1735,9 @@ public class BinaryMapIndexReader {
public TIntHashSet positiveLayers = new TIntHashSet(2);
public TIntHashSet negativeLayers = new TIntHashSet(2);
// to speed up comparision
private MapIndex referenceMapIndex;
public Integer getRule(String t, String v) {
Map<String, Integer> m = encodingRules.get(t);
if (m != null) {
@ -1835,12 +1838,13 @@ public class BinaryMapIndexReader {
}
public BinaryMapDataObject adoptMapObject(BinaryMapDataObject o) {
if(o.mapIndex == this) {
if(o.mapIndex == this || o.mapIndex == referenceMapIndex) {
return o;
}
if(encodingRules.isEmpty()) {
encodingRules.putAll(o.mapIndex.encodingRules);
decodingRules.putAll(o.mapIndex.decodingRules);
referenceMapIndex = o.mapIndex;
return o;
}
TIntArrayList types = new TIntArrayList();
@ -1852,8 +1856,8 @@ public class BinaryMapIndexReader {
if(r != null) {
types.add(r);
} else {
int nid = decodingRules.size();
initMapEncodingRule(tp.additionalAttribute, decodingRules.size(), tp.tag, tp.value);
int nid = decodingRules.size() + 1;
initMapEncodingRule(tp.additionalAttribute, nid, tp.tag, tp.value);
types.add(nid);
}
}
@ -1865,8 +1869,8 @@ public class BinaryMapIndexReader {
if(r != null) {
additionalTypes.add(r);
} else {
int nid = decodingRules.size();
initMapEncodingRule(tp.additionalAttribute, decodingRules.size(), tp.tag, tp.value);
int nid = decodingRules.size() + 1;
initMapEncodingRule(tp.additionalAttribute, nid, tp.tag, tp.value);
additionalTypes.add(nid);
}
}
@ -1887,8 +1891,8 @@ public class BinaryMapIndexReader {
bm.namesOrder.add(r);
bm.objectNames.put(r, name);
} else {
int nid = decodingRules.size();
initMapEncodingRule(tp.additionalAttribute, decodingRules.size(), tp.tag, tp.value);
int nid = decodingRules.size() + 1;
initMapEncodingRule(tp.additionalAttribute, nid, tp.tag, tp.value);
additionalTypes.add(nid);
bm.objectNames.put(nid, name);
}