Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
576c993f47
3 changed files with 19 additions and 9 deletions
|
@ -81,8 +81,8 @@ public class BinaryInspector {
|
||||||
// "-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")+"/2017_08_24_15_00.obf"
|
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")+"../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",
|
||||||
});
|
});
|
||||||
|
|
|
@ -202,6 +202,12 @@ public class BinaryMapDataObject {
|
||||||
&& this.area == thatObj.area
|
&& this.area == thatObj.area
|
||||||
&& Arrays.equals(this.polygonInnerCoordinates, thatObj.polygonInnerCoordinates)
|
&& Arrays.equals(this.polygonInnerCoordinates, thatObj.polygonInnerCoordinates)
|
||||||
&& Arrays.equals(this.coordinates, thatObj.coordinates) ) {
|
&& 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;
|
boolean equals = true;
|
||||||
if(equals) {
|
if(equals) {
|
||||||
if(types == null || thatObj.types == null) {
|
if(types == null || thatObj.types == null) {
|
||||||
|
|
|
@ -1735,6 +1735,9 @@ public class BinaryMapIndexReader {
|
||||||
public TIntHashSet positiveLayers = new TIntHashSet(2);
|
public TIntHashSet positiveLayers = new TIntHashSet(2);
|
||||||
public TIntHashSet negativeLayers = new TIntHashSet(2);
|
public TIntHashSet negativeLayers = new TIntHashSet(2);
|
||||||
|
|
||||||
|
// to speed up comparision
|
||||||
|
private MapIndex referenceMapIndex;
|
||||||
|
|
||||||
public Integer getRule(String t, String v) {
|
public Integer getRule(String t, String v) {
|
||||||
Map<String, Integer> m = encodingRules.get(t);
|
Map<String, Integer> m = encodingRules.get(t);
|
||||||
if (m != null) {
|
if (m != null) {
|
||||||
|
@ -1835,12 +1838,13 @@ public class BinaryMapIndexReader {
|
||||||
}
|
}
|
||||||
|
|
||||||
public BinaryMapDataObject adoptMapObject(BinaryMapDataObject o) {
|
public BinaryMapDataObject adoptMapObject(BinaryMapDataObject o) {
|
||||||
if(o.mapIndex == this) {
|
if(o.mapIndex == this || o.mapIndex == referenceMapIndex) {
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
if(encodingRules.isEmpty()) {
|
if(encodingRules.isEmpty()) {
|
||||||
encodingRules.putAll(o.mapIndex.encodingRules);
|
encodingRules.putAll(o.mapIndex.encodingRules);
|
||||||
decodingRules.putAll(o.mapIndex.decodingRules);
|
decodingRules.putAll(o.mapIndex.decodingRules);
|
||||||
|
referenceMapIndex = o.mapIndex;
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
TIntArrayList types = new TIntArrayList();
|
TIntArrayList types = new TIntArrayList();
|
||||||
|
@ -1852,8 +1856,8 @@ public class BinaryMapIndexReader {
|
||||||
if(r != null) {
|
if(r != null) {
|
||||||
types.add(r);
|
types.add(r);
|
||||||
} else {
|
} else {
|
||||||
int nid = decodingRules.size();
|
int nid = decodingRules.size() + 1;
|
||||||
initMapEncodingRule(tp.additionalAttribute, decodingRules.size(), tp.tag, tp.value);
|
initMapEncodingRule(tp.additionalAttribute, nid, tp.tag, tp.value);
|
||||||
types.add(nid);
|
types.add(nid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1865,8 +1869,8 @@ public class BinaryMapIndexReader {
|
||||||
if(r != null) {
|
if(r != null) {
|
||||||
additionalTypes.add(r);
|
additionalTypes.add(r);
|
||||||
} else {
|
} else {
|
||||||
int nid = decodingRules.size();
|
int nid = decodingRules.size() + 1;
|
||||||
initMapEncodingRule(tp.additionalAttribute, decodingRules.size(), tp.tag, tp.value);
|
initMapEncodingRule(tp.additionalAttribute, nid, tp.tag, tp.value);
|
||||||
additionalTypes.add(nid);
|
additionalTypes.add(nid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1887,8 +1891,8 @@ public class BinaryMapIndexReader {
|
||||||
bm.namesOrder.add(r);
|
bm.namesOrder.add(r);
|
||||||
bm.objectNames.put(r, name);
|
bm.objectNames.put(r, name);
|
||||||
} else {
|
} else {
|
||||||
int nid = decodingRules.size();
|
int nid = decodingRules.size() + 1;
|
||||||
initMapEncodingRule(tp.additionalAttribute, decodingRules.size(), tp.tag, tp.value);
|
initMapEncodingRule(tp.additionalAttribute, nid, tp.tag, tp.value);
|
||||||
additionalTypes.add(nid);
|
additionalTypes.add(nid);
|
||||||
bm.objectNames.put(nid, name);
|
bm.objectNames.put(nid, name);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue