mirror of
https://github.com/cfpwastaken/planetiler-openmaptiles.git
synced 2026-02-04 12:31:10 +00:00
Fix error processing way (#87)
This commit is contained in:
@@ -349,6 +349,10 @@ public class Transportation implements
|
||||
}
|
||||
int minzoom = getMinzoom(element, highwayClass);
|
||||
|
||||
if (minzoom > config.maxzoom()) {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean highwayRamp = isLink(highway);
|
||||
Integer rampAboveZ12 = (highwayRamp || element.isRamp()) ? 1 : null;
|
||||
Integer rampBelowZ12 = highwayRamp ? 1 : null;
|
||||
@@ -409,7 +413,7 @@ public class Transportation implements
|
||||
case FieldValues.CLASS_SERVICE -> isDrivewayOrParkingAisle(service(element.service())) ? 14 : 13;
|
||||
case FieldValues.CLASS_TRACK, FieldValues.CLASS_PATH -> routeRank == 1 ? 12 :
|
||||
(z13Paths || !nullOrEmpty(element.name()) || routeRank <= 2 || !nullOrEmpty(element.sacScale())) ? 13 : 14;
|
||||
default -> MINZOOMS.get(baseClass);
|
||||
default -> MINZOOMS.getOrDefault(baseClass, Integer.MAX_VALUE);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -253,6 +253,9 @@ public class TransportationName implements
|
||||
|
||||
// inherit min zoom threshold from visible road, and ensure we never show a label on a road that's not visible yet.
|
||||
minzoom = Math.max(minzoom, transportation.getMinzoom(element, highwayClass));
|
||||
if (minzoom > config.maxzoom()) {
|
||||
return;
|
||||
}
|
||||
|
||||
FeatureCollector.Feature feature = features.line(LAYER_NAME)
|
||||
.setBufferPixels(BUFFER_SIZE)
|
||||
|
||||
@@ -1280,4 +1280,39 @@ class TransportationTest extends AbstractLayerTest {
|
||||
"class", "path"
|
||||
)), collector);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testIssue86() {
|
||||
assertFeatures(14, List.of(Map.of(
|
||||
"_layer", "transportation",
|
||||
"class", "bridge",
|
||||
"_minzoom", 13,
|
||||
"_type", "polygon"
|
||||
)), process(closedWayFeature(Map.of(
|
||||
"layer", "1",
|
||||
"man_made", "bridge",
|
||||
"service", "driveway"
|
||||
))));
|
||||
assertFeatures(14, List.of(Map.of(
|
||||
"_layer", "transportation",
|
||||
"class", "bridge",
|
||||
"_minzoom", 13,
|
||||
"_type", "polygon"
|
||||
)), process(closedWayFeature(Map.of(
|
||||
"layer", "1",
|
||||
"man_made", "bridge",
|
||||
"service", "driveway",
|
||||
"name", "name"
|
||||
))));
|
||||
assertFeatures(14, List.of(Map.of(
|
||||
"_layer", "transportation",
|
||||
"class", "pier",
|
||||
"_minzoom", 13,
|
||||
"_type", "polygon"
|
||||
)), process(closedWayFeature(Map.of(
|
||||
"layer", "1",
|
||||
"man_made", "pier",
|
||||
"service", "driveway"
|
||||
))));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user