Update rendering types'
This commit is contained in:
parent
2612e665ad
commit
512e76806f
2 changed files with 15 additions and 51 deletions
|
@ -64,8 +64,11 @@ public class IndexVectorMapCreator extends AbstractIndexPartCreator {
|
||||||
|
|
||||||
private Map<Long, List<Long>> highwayRestrictions = new LinkedHashMap<Long, List<Long>>();
|
private Map<Long, List<Long>> highwayRestrictions = new LinkedHashMap<Long, List<Long>>();
|
||||||
|
|
||||||
// local purpose
|
// local purpose to speed up processing cache allocation
|
||||||
TIntArrayList typeUse = new TIntArrayList(8);
|
TIntArrayList typeUse = new TIntArrayList(8);
|
||||||
|
List<MapRulType> tempNameUse = new ArrayList<MapRenderingTypes.MapRulType>();
|
||||||
|
Map<MapRulType, String> namesUse = new LinkedHashMap<MapRenderingTypes.MapRulType, String>();
|
||||||
|
TIntArrayList addtypeUse = new TIntArrayList(8);
|
||||||
List<Long> restrictionsUse = new ArrayList<Long>(8);
|
List<Long> restrictionsUse = new ArrayList<Long>(8);
|
||||||
|
|
||||||
private PreparedStatement mapBinaryStat;
|
private PreparedStatement mapBinaryStat;
|
||||||
|
@ -508,63 +511,24 @@ public class IndexVectorMapCreator extends AbstractIndexPartCreator {
|
||||||
if (e instanceof Way || e instanceof Node) {
|
if (e instanceof Way || e instanceof Node) {
|
||||||
// manipulate what kind of way to load
|
// manipulate what kind of way to load
|
||||||
ctx.loadEntityData(e);
|
ctx.loadEntityData(e);
|
||||||
for (int i = 0; i < mapZooms.size(); i++) {
|
for (int level = 0; level < mapZooms.size(); level++) {
|
||||||
boolean inverse = i == 0 ? oneway : false;
|
boolean area = renderingTypes.encodeEntityWithType(e, mapZooms.getLevel(level).getMaxZoom(), false,
|
||||||
int type = renderingTypes.encodeEntityWithType(e, mapZooms.getLevel(level).getMaxZoom(), false, typeUse);
|
typeUse, addtypeUse, namesUse, tempNameUse);
|
||||||
|
if(typeUse.isEmpty()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Map<Long, Set<Integer>> multiPolygonsWays = this.multiPolygonsWays[level];
|
Map<Long, Set<Integer>> multiPolygonsWays = this.multiPolygonsWays[level];
|
||||||
boolean hasMulti = e instanceof Way && multiPolygonsWays.containsKey(e.getId());
|
boolean hasMulti = e instanceof Way && multiPolygonsWays.containsKey(e.getId());
|
||||||
if (hasMulti) {
|
if (hasMulti) {
|
||||||
Set<Integer> set = multiPolygonsWays.get(e.getId());
|
Set<Integer> set = multiPolygonsWays.get(e.getId());
|
||||||
boolean first = true;
|
typeUse.removeAll(set);
|
||||||
for (Integer i : set) {
|
|
||||||
if (first && type == 0) {
|
|
||||||
type = i;
|
|
||||||
first = false;
|
|
||||||
} else {
|
|
||||||
// do not compare direction
|
|
||||||
int k = i & 0x7fff;
|
|
||||||
int ks = k | MapRenderingTypes.POLYGON_TYPE;
|
|
||||||
// turn of polygon type 3 ^ (suppose polygon = multipolygon)
|
|
||||||
if (ks == type) {
|
|
||||||
type = i;
|
|
||||||
} else {
|
|
||||||
int ind = typeUse.indexOf(ks);
|
|
||||||
if (ind == -1) {
|
|
||||||
typeUse.add(i);
|
|
||||||
} else {
|
|
||||||
typeUse.set(ind, i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if(typeUse.isEmpty()) {
|
||||||
if (type == 0) {
|
continue;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
long id = convertBaseIdToGeneratedId(e.getId(), level);
|
||||||
restrictionsUse.clear();
|
|
||||||
// try to find restrictions only for max zoom level
|
|
||||||
if (level == 0 && highwayRestrictions.containsKey(baseId)) {
|
|
||||||
restrictionsUse.addAll(highwayRestrictions.get(baseId));
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean point = (type & 3) == MapRenderingTypes.POINT_TYPE;
|
|
||||||
RTree rtree = null;
|
|
||||||
long id = convertBaseIdToGeneratedId(baseId, level);
|
|
||||||
rtree = mapTree[level];
|
|
||||||
|
|
||||||
boolean skip = false;
|
boolean skip = false;
|
||||||
|
|
||||||
String eName = renderingTypes.getEntityName(e);
|
|
||||||
if (eName == null) {
|
|
||||||
eName = multiPolygonsNames.get(baseId);
|
|
||||||
}
|
|
||||||
int highwayAttributes = 0;
|
|
||||||
if (e.getTag(OSMTagKey.HIGHWAY) != null) {
|
|
||||||
highwayAttributes = MapRenderingTypes.getHighwayAttributes(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (e instanceof Way) {
|
if (e instanceof Way) {
|
||||||
id |= 1;
|
id |= 1;
|
||||||
// simplify route
|
// simplify route
|
||||||
|
|
|
@ -137,7 +137,7 @@ public class MapRenderingTypes {
|
||||||
tempList.add(rType.names[i]);
|
tempList.add(rType.names[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rType.additional) {
|
if (rType.additional) {
|
||||||
outaddTypes.add(rType.id);
|
outaddTypes.add(rType.id);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue