mirror of
https://github.com/cfpwastaken/planetiler-openmaptiles.git
synced 2026-02-04 12:31:10 +00:00
Include route relations without a network type (#68)
This commit is contained in:
@@ -288,7 +288,7 @@ public class Transportation implements
|
|||||||
default -> (relation.hasTag("osmc:symbol") || relation.hasTag("colour")) ? 2 : 3;
|
default -> (relation.hasTag("osmc:symbol") || relation.hasTag("colour")) ? 2 : 3;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (networkType != null || rank < 3) {
|
if (network != null || rank < 3) {
|
||||||
return List.of(new RouteRelation(coalesce(ref, ""), network, networkType, (byte) rank, relation.id()));
|
return List.of(new RouteRelation(coalesce(ref, ""), network, networkType, (byte) rank, relation.id()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -339,6 +339,38 @@ public class TransportationTest extends AbstractLayerTest {
|
|||||||
)), features);
|
)), features);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testRouteWithoutNetworkType() {
|
||||||
|
var rel = new OsmElement.Relation(1);
|
||||||
|
rel.setTag("type", "route");
|
||||||
|
rel.setTag("route", "road");
|
||||||
|
rel.setTag("network", "US:NJ:NJTP");
|
||||||
|
rel.setTag("ref", "NJTP");
|
||||||
|
rel.setTag("name", "New Jersey Turnpike (mainline)");
|
||||||
|
|
||||||
|
FeatureCollector rendered = process(lineFeatureWithRelation(
|
||||||
|
profile.preprocessOsmRelation(rel),
|
||||||
|
Map.of(
|
||||||
|
"highway", "motorway",
|
||||||
|
"name", "New Jersey Turnpike",
|
||||||
|
"ref", "I 95;NJTP"
|
||||||
|
)));
|
||||||
|
|
||||||
|
assertFeatures(13, List.of(mapOf(
|
||||||
|
"_layer", "transportation",
|
||||||
|
"class", "motorway",
|
||||||
|
"_minzoom", 4
|
||||||
|
), Map.of(
|
||||||
|
"_layer", "transportation_name",
|
||||||
|
"class", "motorway",
|
||||||
|
"name", "New Jersey Turnpike",
|
||||||
|
"ref", "NJTP",
|
||||||
|
"ref_length", 4,
|
||||||
|
"route_1", "US:NJ:NJTP=NJTP",
|
||||||
|
"_minzoom", 6
|
||||||
|
)), rendered);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMotorwayJunction() {
|
public void testMotorwayJunction() {
|
||||||
var otherNode1 = new OsmElement.Node(1, 1, 1);
|
var otherNode1 = new OsmElement.Node(1, 1, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user