From 3b96fa58baf0aad743484ed9fc2c2adf374417a0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 29 Sep 2023 05:31:07 -0400 Subject: [PATCH 1/8] Bump com.diffplug.spotless:spotless-maven-plugin from 2.38.0 to 2.40.0 (#116) Bumps [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless) from 2.38.0 to 2.40.0. - [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md) - [Commits](https://github.com/diffplug/spotless/compare/lib/2.38.0...lib/2.40.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 b21b1a22..5ad75986 100644 --- a/pom.xml +++ b/pom.xml @@ -110,7 +110,7 @@ com.diffplug.spotless spotless-maven-plugin - 2.38.0 + 2.40.0 From d4aaae894b02e6feb5d1ae042bf31c1bcfa73c49 Mon Sep 17 00:00:00 2001 From: Michael Barry Date: Sun, 1 Oct 2023 06:41:48 -0400 Subject: [PATCH 2/8] Deduplicate and remove limit on concurrent routes (#117) --- .../layers/TransportationName.java | 22 ++++------ .../layers/TransportationTest.java | 42 +++++++++++++++++++ 2 files changed, 51 insertions(+), 13 deletions(-) diff --git a/src/main/java/org/openmaptiles/layers/TransportationName.java b/src/main/java/org/openmaptiles/layers/TransportationName.java index 86b5c657..5f8a4f83 100644 --- a/src/main/java/org/openmaptiles/layers/TransportationName.java +++ b/src/main/java/org/openmaptiles/layers/TransportationName.java @@ -57,8 +57,10 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE import com.onthegomap.planetiler.util.ZoomFunction; import java.util.Arrays; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.function.Function; import org.openmaptiles.OpenMapTilesProfile; import org.openmaptiles.generated.OpenMapTilesSchema; @@ -111,14 +113,6 @@ public class TransportationName implements .put(9, 8_000) .put(10, 8_000) .put(11, 8_000); - private static final List CONCURRENT_ROUTE_KEYS = List.of( - Fields.ROUTE_1, - Fields.ROUTE_2, - Fields.ROUTE_3, - Fields.ROUTE_4, - Fields.ROUTE_5, - Fields.ROUTE_6 - ); private final boolean brunnel; private final boolean sizeForShield; private final boolean limitMerge; @@ -273,11 +267,13 @@ public void process(Tables.OsmHighwayLinestring element, FeatureCollector featur .setSortKey(element.zOrder()) .setMinZoom(minzoom); - // populate route_1, route_2, ... tags - for (int i = 0; i < Math.min(CONCURRENT_ROUTE_KEYS.size(), relations.size()); i++) { - Transportation.RouteRelation routeRelation = relations.get(i); - feature.setAttr(CONCURRENT_ROUTE_KEYS.get(i), routeRelation.network() == null ? null : - routeRelation.network() + "=" + coalesce(routeRelation.ref(), "")); + // populate route_1, route_2, ... route_n tags and remove duplicates + Set routes = new HashSet<>(); + for (var route : relations) { + String routeString = route.network() + "=" + coalesce(route.ref(), ""); + if (routes.add(routeString)) { + feature.setAttr("route_" + routes.size(), routeString); + } } if (brunnel) { diff --git a/src/test/java/org/openmaptiles/layers/TransportationTest.java b/src/test/java/org/openmaptiles/layers/TransportationTest.java index 5f1e6636..dbc3d411 100644 --- a/src/test/java/org/openmaptiles/layers/TransportationTest.java +++ b/src/test/java/org/openmaptiles/layers/TransportationTest.java @@ -11,7 +11,9 @@ import com.onthegomap.planetiler.reader.SimpleFeature; import com.onthegomap.planetiler.reader.SourceFeature; import com.onthegomap.planetiler.reader.osm.OsmElement; +import com.onthegomap.planetiler.reader.osm.OsmRelationInfo; import com.onthegomap.planetiler.stats.Stats; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.stream.Stream; @@ -382,6 +384,46 @@ void testRouteWithoutNetworkType() { )), rendered); } + @Test + void testSegmentWithManyRoutes() { + List relations = new ArrayList<>(); + for (int route = 1; route <= 16; route++) { + int num = (route + 1) / 2; // to make dups + var rel = new OsmElement.Relation(route); + rel.setTag("type", "route"); + rel.setTag("route", "road"); + rel.setTag("network", "US:I"); + rel.setTag("ref", Integer.toString(num)); + rel.setTag("name", "Route " + num); + relations.addAll(profile.preprocessOsmRelation(rel)); + } + + FeatureCollector rendered = process(lineFeatureWithRelation( + relations, + Map.of( + "highway", "motorway", + "name", "New Jersey Turnpike", + "ref", "I 95;NJTP" + ))); + + assertFeatures(13, List.of(mapOf( + "_layer", "transportation", + "class", "motorway", + "_minzoom", 4 + ), mapOf( + "_layer", "transportation_name", + "route_1", "US:I=1", + "route_2", "US:I=2", + "route_3", "US:I=3", + "route_4", "US:I=4", + "route_5", "US:I=5", + "route_6", "US:I=6", + "route_7", "US:I=7", + "route_8", "US:I=8", + "route_9", "" + )), rendered); + } + @Test void testMinorRouteRef() { var rel1 = new OsmElement.Relation(1); From 613d0a8f7eba34ef75ac202538843f78b0e28284 Mon Sep 17 00:00:00 2001 From: Michael Barry Date: Tue, 3 Oct 2023 05:33:26 -0400 Subject: [PATCH 3/8] Upgrade to planetiler 0.7-SNAPSHOT (#118) upgrade to planetiler 0.7.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5ad75986..c012c798 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ UTF-8 17 17 - 0.6-SNAPSHOT + 0.7-SNAPSHOT 5.10.0 org.openmaptiles.OpenMapTilesMain From 28411e8d7b3398a448b1ef59caae97703ebe1ff7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 21 Oct 2023 17:53:13 -0400 Subject: [PATCH 4/8] Bump styfle/cancel-workflow-action from 0.11.0 to 0.12.0 (#119) --- .github/workflows/performance.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index ca9bcc7a..9286b6d1 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -23,7 +23,7 @@ jobs: continue-on-error: true steps: - name: 'Cancel previous runs' - uses: styfle/cancel-workflow-action@0.11.0 + uses: styfle/cancel-workflow-action@0.12.0 with: access_token: ${{ github.token }} From c07e9e16d829dbb89acc6b1ed1c6ca0d85d90b1b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 06:18:35 -0400 Subject: [PATCH 5/8] Bump org.apache.maven.plugins:maven-failsafe-plugin from 3.1.2 to 3.2.1 (#122) Bumps [org.apache.maven.plugins:maven-failsafe-plugin](https://github.com/apache/maven-surefire) from 3.1.2 to 3.2.1. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.1.2...surefire-3.2.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-failsafe-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 c012c798..e7532362 100644 --- a/pom.xml +++ b/pom.xml @@ -104,7 +104,7 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.1.2 + 3.2.1 From f885ed7ae57b33b1098e3848c7d18cef9ca9991a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 06:18:58 -0400 Subject: [PATCH 6/8] Bump actions/setup-node from 3 to 4 (#121) Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/performance.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index 9286b6d1..5ae3f433 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -48,7 +48,7 @@ jobs: java-version: 17 distribution: 'temurin' cache: 'maven' - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: '14' - run: npm install -g strip-ansi-cli@3.0.2 From 01b3b0e6ec14fd6d844e9c84227514a5d53bc503 Mon Sep 17 00:00:00 2001 From: Michael Barry Date: Wed, 25 Oct 2023 20:48:05 -0400 Subject: [PATCH 7/8] Use java 21 (#124) --- .github/workflows/maven.yml | 19 +++++++------------ .github/workflows/performance.yml | 2 +- .github/workflows/snapshot.yml | 2 +- README.md | 2 +- pom.xml | 10 +++++----- 5 files changed, 15 insertions(+), 20 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 9df74c73..1904de23 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -17,10 +17,10 @@ jobs: steps: - name: Checkout this PR planetiler-openmaptiles repo uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v3 with: - java-version: 17 + java-version: 21 distribution: 'temurin' cache: 'maven' - name: Ensure code formatted with mvn spotless:apply @@ -33,12 +33,7 @@ jobs: fail-fast: false matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] - jdk: [ 17 ] - include: - - os: ubuntu-latest - jdk: 18 - - os: ubuntu-latest - jdk: 19 + jdk: [ 21 ] runs-on: ${{ matrix.os }} timeout-minutes: 15 steps: @@ -66,10 +61,10 @@ jobs: steps: - name: Checkout this PR planetiler-openmaptiles repo uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v3 with: - java-version: 17 + java-version: 21 distribution: 'temurin' cache: 'maven' - run: ./scripts/regenerate-openmaptiles.sh @@ -88,7 +83,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 17 + java-version: 21 distribution: 'temurin' cache: 'maven' - name: Build this branch @@ -127,7 +122,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 17 + java-version: 21 distribution: 'temurin' cache: 'maven' - name: Build and test this branch diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index 5ae3f433..eb6d8b37 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -45,7 +45,7 @@ jobs: - name: 'Set up JDK' uses: actions/setup-java@v3 with: - java-version: 17 + java-version: 21 distribution: 'temurin' cache: 'maven' - uses: actions/setup-node@v4 diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 227d8e1d..4fe12506 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -14,7 +14,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 17 + java-version: 21 distribution: 'temurin' cache: 'maven' - name: Login to Docker Hub diff --git a/README.md b/README.md index 6f383863..90ae11ff 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Using pre-built docker image: docker run -v "$(pwd)/data":/data openmaptiles/planetiler-openmaptiles:latest --force --download --area=monaco ``` -Or to build from source, after [installing Java 17+](https://adoptium.net/installation.html): +Or to build from source, after [installing Java 21+](https://adoptium.net/installation.html): ```bash # Build the project (use mvnw.cmd on windows): diff --git a/pom.xml b/pom.xml index e7532362..0f26a9be 100644 --- a/pom.xml +++ b/pom.xml @@ -7,8 +7,8 @@ UTF-8 - 17 - 17 + 21 + 21 0.7-SNAPSHOT 5.10.0 @@ -140,7 +140,7 @@ - + org.apache.maven.plugins maven-enforcer-plugin @@ -154,7 +154,7 @@ - 17 + 21 @@ -209,7 +209,7 @@ - eclipse-temurin:17-jre + eclipse-temurin:21-jre From 7dbbc5089e8ca5607d9c3ecf1991d35b1de5c6cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 20:48:21 -0400 Subject: [PATCH 8/8] Bump org.apache.maven.plugins:maven-surefire-plugin from 3.1.2 to 3.2.1 (#123) Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.1.2 to 3.2.1. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.1.2...surefire-3.2.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-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 0f26a9be..1320ddb6 100644 --- a/pom.xml +++ b/pom.xml @@ -99,7 +99,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.1.2 + 3.2.1 org.apache.maven.plugins