From ddf65a8139226d94f42b4e691e88c237210e5b97 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Mar 2023 07:19:52 -0400 Subject: [PATCH 1/4] Bump maven-failsafe-plugin from 3.0.0-M9 to 3.0.0 (#82) Bumps [maven-failsafe-plugin](https://github.com/apache/maven-surefire) from 3.0.0-M9 to 3.0.0. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.0.0-M9...surefire-3.0.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-failsafe-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 150b7ac6..9a5c02ce 100644 --- a/pom.xml +++ b/pom.xml @@ -104,7 +104,7 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.0.0-M9 + 3.0.0 From b061c97aa0be9c38565f33af408a3c01753cff5a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 05:17:21 -0400 Subject: [PATCH 2/4] Bump maven-surefire-plugin from 3.0.0-M9 to 3.0.0 (#83) Bumps [maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.0.0-M9 to 3.0.0. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.0.0-M9...surefire-3.0.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9a5c02ce..fba40073 100644 --- a/pom.xml +++ b/pom.xml @@ -99,7 +99,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M9 + 3.0.0 org.apache.maven.plugins From d96c612841a2ffc3b1e5406f88c194295d26257b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Apr 2023 05:23:09 -0400 Subject: [PATCH 3/4] Bump spotless-maven-plugin from 2.33.0 to 2.36.0 (#85) Bumps [spotless-maven-plugin](https://github.com/diffplug/spotless) from 2.33.0 to 2.36.0. - [Release notes](https://github.com/diffplug/spotless/releases) - [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md) - [Commits](https://github.com/diffplug/spotless/compare/lib/2.33.0...lib/2.36.0) --- updated-dependencies: - dependency-name: com.diffplug.spotless:spotless-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fba40073..97880d4f 100644 --- a/pom.xml +++ b/pom.xml @@ -110,7 +110,7 @@ com.diffplug.spotless spotless-maven-plugin - 2.33.0 + 2.36.0 From 6317d82ec9dff205cd2de90d020433592009e807 Mon Sep 17 00:00:00 2001 From: Michael Barry Date: Fri, 14 Apr 2023 05:55:09 -0400 Subject: [PATCH 4/4] Fix error processing way (#87) --- .../openmaptiles/layers/Transportation.java | 6 +++- .../layers/TransportationName.java | 3 ++ .../layers/TransportationTest.java | 35 +++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/openmaptiles/layers/Transportation.java b/src/main/java/org/openmaptiles/layers/Transportation.java index 938b9959..585b0384 100644 --- a/src/main/java/org/openmaptiles/layers/Transportation.java +++ b/src/main/java/org/openmaptiles/layers/Transportation.java @@ -349,6 +349,10 @@ public void process(Tables.OsmHighwayLinestring element, FeatureCollector featur } 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 @@ int getMinzoom(Tables.OsmHighwayLinestring element, String highwayClass) { 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); }; } diff --git a/src/main/java/org/openmaptiles/layers/TransportationName.java b/src/main/java/org/openmaptiles/layers/TransportationName.java index 8d0cb8bb..86b5c657 100644 --- a/src/main/java/org/openmaptiles/layers/TransportationName.java +++ b/src/main/java/org/openmaptiles/layers/TransportationName.java @@ -253,6 +253,9 @@ public void process(Tables.OsmHighwayLinestring element, FeatureCollector featur // 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) diff --git a/src/test/java/org/openmaptiles/layers/TransportationTest.java b/src/test/java/org/openmaptiles/layers/TransportationTest.java index 8295824b..5f1e6636 100644 --- a/src/test/java/org/openmaptiles/layers/TransportationTest.java +++ b/src/test/java/org/openmaptiles/layers/TransportationTest.java @@ -1280,4 +1280,39 @@ void testTransportationNameLayerRequiresTransportationLayer() { "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" + )))); + } }