mirror of
https://github.com/cfpwastaken/planetiler-openmaptiles.git
synced 2026-03-21 22:39:27 +00:00
feat(transportation): add motorroad subclass
This commit is contained in:
@@ -345,7 +345,7 @@ public class Tables {
|
||||
@Override String service, @Override String access, @Override boolean toll, @Override String usage,
|
||||
@Override String publicTransport, @Override String manMade, @Override String bicycle, @Override String foot,
|
||||
@Override String horse, @Override String mtbScale, @Override String sacScale, @Override String surface,
|
||||
@Override boolean expressway, @Override SourceFeature source)
|
||||
@Override boolean expressway, String motorroad, @Override SourceFeature source)
|
||||
implements Row, WithHighway, WithConstruction, WithTracktype, WithRef, WithNetwork, WithZOrder, WithLayer,
|
||||
WithLevel, WithIndoor, WithName, WithNameEn, WithNameDe, WithIsTunnel, WithIsBridge, WithIsRamp, WithIsFord,
|
||||
WithIsOneway, WithIsArea, WithService, WithAccess, WithToll, WithUsage, WithPublicTransport, WithManMade,
|
||||
@@ -359,7 +359,7 @@ public class Tables {
|
||||
source.getString("service"), source.getString("access"), source.getBoolean("toll"), source.getString("usage"),
|
||||
source.getString("public_transport"), source.getString("man_made"), source.getString("bicycle"),
|
||||
source.getString("foot"), source.getString("horse"), source.getString("mtb:scale"),
|
||||
source.getString("sac_scale"), source.getString("surface"), source.getBoolean("expressway"), source);
|
||||
source.getString("sac_scale"), source.getString("surface"), source.getBoolean("expressway"), source.getString("motorroad"), source);
|
||||
}
|
||||
|
||||
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
|
||||
|
||||
@@ -240,7 +240,10 @@ public class Transportation implements
|
||||
), null) : isBridgeOrPier(manMade) ? manMade : null;
|
||||
}
|
||||
|
||||
static String highwaySubclass(String highwayClass, String publicTransport, String highway) {
|
||||
static String highwaySubclass(String highwayClass, String publicTransport, String highway, String motorroad) {
|
||||
if(motorroad != null && motorroad.equals("yes")) {
|
||||
return "motorroad";
|
||||
}
|
||||
return FieldValues.CLASS_PATH.equals(highwayClass) ? coalesce(nullIfEmpty(publicTransport), highway) : null;
|
||||
}
|
||||
|
||||
@@ -495,7 +498,7 @@ public class Transportation implements
|
||||
FeatureCollector.Feature feature = features.line(LAYER_NAME).setBufferPixels(BUFFER_SIZE)
|
||||
// main attributes at all zoom levels (used for grouping <= z8)
|
||||
.setAttr(Fields.CLASS, highwayClass)
|
||||
.setAttr(Fields.SUBCLASS, highwaySubclass(highwayClass, element.publicTransport(), highway))
|
||||
.setAttr(Fields.SUBCLASS, highwaySubclass(highwayClass, element.publicTransport(), highway, element.motorroad()))
|
||||
.setAttr(Fields.NETWORK, networkType != null ? networkType.name : null)
|
||||
.setAttr("maxspeed", element.source().getTag("maxspeed"))
|
||||
.setAttr("overtaking", element.source().getTag("overtaking"))
|
||||
@@ -665,7 +668,7 @@ public class Transportation implements
|
||||
if (highwayClass != null) {
|
||||
features.polygon(LAYER_NAME).setBufferPixels(BUFFER_SIZE)
|
||||
.setAttr(Fields.CLASS, highwayClass)
|
||||
.setAttr(Fields.SUBCLASS, highwaySubclass(highwayClass, element.publicTransport(), element.highway()))
|
||||
.setAttr(Fields.SUBCLASS, highwaySubclass(highwayClass, element.publicTransport(), element.highway(), null))
|
||||
.setAttr(Fields.BRUNNEL, brunnel("bridge".equals(manMade), false, false))
|
||||
.setAttr(Fields.LAYER, nullIfLong(element.layer(), 0))
|
||||
.setSortKey(element.zOrder())
|
||||
|
||||
@@ -265,7 +265,7 @@ public class TransportationName implements
|
||||
firstRelationWithNetwork != null ? firstRelationWithNetwork.networkType().name : !nullOrEmpty(ref) ? "road" :
|
||||
null)
|
||||
.setAttr(Fields.CLASS, highwayClass)
|
||||
.setAttr(Fields.SUBCLASS, highwaySubclass(highwayClass, null, highway))
|
||||
.setAttr(Fields.SUBCLASS, highwaySubclass(highwayClass, null, highway, element.motorroad()))
|
||||
.setMinPixelSize(0)
|
||||
.setSortKey(element.zOrder())
|
||||
.setMinZoom(minzoom)
|
||||
|
||||
Reference in New Issue
Block a user