feat(transportation): add motorroad subclass

This commit is contained in:
2026-02-13 12:29:32 +01:00
parent 5b715da30c
commit 896c34a146
3 changed files with 9 additions and 6 deletions

View File

@@ -345,7 +345,7 @@ public class Tables {
@Override String service, @Override String access, @Override boolean toll, @Override String usage, @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 publicTransport, @Override String manMade, @Override String bicycle, @Override String foot,
@Override String horse, @Override String mtbScale, @Override String sacScale, @Override String surface, @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, implements Row, WithHighway, WithConstruction, WithTracktype, WithRef, WithNetwork, WithZOrder, WithLayer,
WithLevel, WithIndoor, WithName, WithNameEn, WithNameDe, WithIsTunnel, WithIsBridge, WithIsRamp, WithIsFord, WithLevel, WithIndoor, WithName, WithNameEn, WithNameDe, WithIsTunnel, WithIsBridge, WithIsRamp, WithIsFord,
WithIsOneway, WithIsArea, WithService, WithAccess, WithToll, WithUsage, WithPublicTransport, WithManMade, 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("service"), source.getString("access"), source.getBoolean("toll"), source.getString("usage"),
source.getString("public_transport"), source.getString("man_made"), source.getString("bicycle"), source.getString("public_transport"), source.getString("man_made"), source.getString("bicycle"),
source.getString("foot"), source.getString("horse"), source.getString("mtb:scale"), 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". */ /** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */

View File

@@ -240,7 +240,10 @@ public class Transportation implements
), null) : isBridgeOrPier(manMade) ? manMade : null; ), 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; 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) FeatureCollector.Feature feature = features.line(LAYER_NAME).setBufferPixels(BUFFER_SIZE)
// main attributes at all zoom levels (used for grouping <= z8) // main attributes at all zoom levels (used for grouping <= z8)
.setAttr(Fields.CLASS, highwayClass) .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(Fields.NETWORK, networkType != null ? networkType.name : null)
.setAttr("maxspeed", element.source().getTag("maxspeed")) .setAttr("maxspeed", element.source().getTag("maxspeed"))
.setAttr("overtaking", element.source().getTag("overtaking")) .setAttr("overtaking", element.source().getTag("overtaking"))
@@ -665,7 +668,7 @@ public class Transportation implements
if (highwayClass != null) { if (highwayClass != null) {
features.polygon(LAYER_NAME).setBufferPixels(BUFFER_SIZE) features.polygon(LAYER_NAME).setBufferPixels(BUFFER_SIZE)
.setAttr(Fields.CLASS, highwayClass) .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.BRUNNEL, brunnel("bridge".equals(manMade), false, false))
.setAttr(Fields.LAYER, nullIfLong(element.layer(), 0)) .setAttr(Fields.LAYER, nullIfLong(element.layer(), 0))
.setSortKey(element.zOrder()) .setSortKey(element.zOrder())

View File

@@ -265,7 +265,7 @@ public class TransportationName implements
firstRelationWithNetwork != null ? firstRelationWithNetwork.networkType().name : !nullOrEmpty(ref) ? "road" : firstRelationWithNetwork != null ? firstRelationWithNetwork.networkType().name : !nullOrEmpty(ref) ? "road" :
null) null)
.setAttr(Fields.CLASS, highwayClass) .setAttr(Fields.CLASS, highwayClass)
.setAttr(Fields.SUBCLASS, highwaySubclass(highwayClass, null, highway)) .setAttr(Fields.SUBCLASS, highwaySubclass(highwayClass, null, highway, element.motorroad()))
.setMinPixelSize(0) .setMinPixelSize(0)
.setSortKey(element.zOrder()) .setSortKey(element.zOrder())
.setMinZoom(minzoom) .setMinZoom(minzoom)