From ecef9a3e2d0d1f005a4cd3b1e26e34b3e9d06a68 Mon Sep 17 00:00:00 2001 From: boldtrn Date: Tue, 22 Mar 2022 13:58:09 +0100 Subject: [PATCH 1/4] Allow changing the basemap url --- .../main/java/com/onthegomap/planetiler/basemap/Generate.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/planetiler-basemap/src/main/java/com/onthegomap/planetiler/basemap/Generate.java b/planetiler-basemap/src/main/java/com/onthegomap/planetiler/basemap/Generate.java index 1ab032a6b1..0e2337c2fb 100644 --- a/planetiler-basemap/src/main/java/com/onthegomap/planetiler/basemap/Generate.java +++ b/planetiler-basemap/src/main/java/com/onthegomap/planetiler/basemap/Generate.java @@ -129,7 +129,9 @@ public static void main(String[] args) throws IOException { Arguments arguments = Arguments.fromArgsOrConfigFile(args); PlanetilerConfig planetilerConfig = PlanetilerConfig.from(arguments); String tag = arguments.getString("tag", "openmaptiles tag to use", "v3.12.2"); - String base = "https://raw.githubusercontent.com/openmaptiles/openmaptiles/" + tag + "/"; + String baseUrl = arguments.getString("base-url", "the url used to download the openmaptiles.yml", + "https://raw.githubusercontent.com/openmaptiles/openmaptiles/"); + String base = baseUrl + tag + "/"; // start crawling from openmaptiles.yaml // then crawl schema from each layers//.yaml file that it references From 68fd45e6e549c99e28e69b4ef2031d3749905531 Mon Sep 17 00:00:00 2001 From: boldtrn Date: Tue, 22 Mar 2022 15:22:43 +0100 Subject: [PATCH 2/4] Update README and regenerate-openmaptiles.sh --- planetiler-basemap/README.md | 4 ++-- scripts/regenerate-openmaptiles.sh | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/planetiler-basemap/README.md b/planetiler-basemap/README.md index 9771ff72f0..49ac0bcfa4 100644 --- a/planetiler-basemap/README.md +++ b/planetiler-basemap/README.md @@ -1,6 +1,6 @@ # Planetiler Basemap Profile -This basemap profile is based on [OpenMapTiles](https://github.com/openmaptiles/openmaptiles) v3.12.2. +This basemap profile is based on [OpenMapTiles](https://github.com/openmaptiles/openmaptiles) v3.13. See [README.md](../README.md) in the parent directory for instructions on how to run. ## Differences from OpenMapTiles @@ -41,7 +41,7 @@ To run `Generate.java`, use [scripts/regenerate-openmaptiles.sh](../scripts/rege OpenMapTiles release tag: ```bash -./scripts/regenerate-openmaptiles.sh v3.12.2 +./scripts/regenerate-openmaptiles.sh v3.13 https://raw.githubusercontent.com/openmaptiles/openmaptiles/ ``` Then follow the instructions it prints for reformatting generated code. diff --git a/scripts/regenerate-openmaptiles.sh b/scripts/regenerate-openmaptiles.sh index cf42cbd16f..3a4c59b61a 100755 --- a/scripts/regenerate-openmaptiles.sh +++ b/scripts/regenerate-openmaptiles.sh @@ -7,11 +7,14 @@ set -o nounset TAG="${1:-"v3.13"}" echo "tag=${TAG}" +BASE_URL="${2:-"https://raw.githubusercontent.com/openmaptiles/openmaptiles/"}" +echo "base-url=${BASE_URL}" + echo "Building..." ./mvnw -DskipTests=true --projects planetiler-dist -am package echo "Running..." -java -cp planetiler-dist/target/*-with-deps.jar com.onthegomap.planetiler.basemap.Generate -tag="${TAG}" +java -cp planetiler-dist/target/*-with-deps.jar com.onthegomap.planetiler.basemap.Generate -tag="${TAG}" -base-url="${BASE_URL}" echo "Formatting..." ./scripts/format.sh From f1e4f4099e774285338affcc5cd298279dac0b81 Mon Sep 17 00:00:00 2001 From: boldtrn Date: Tue, 22 Mar 2022 15:25:35 +0100 Subject: [PATCH 3/4] Update to v3.13 --- .../main/java/com/onthegomap/planetiler/basemap/Generate.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/planetiler-basemap/src/main/java/com/onthegomap/planetiler/basemap/Generate.java b/planetiler-basemap/src/main/java/com/onthegomap/planetiler/basemap/Generate.java index 0e2337c2fb..554ee3212b 100644 --- a/planetiler-basemap/src/main/java/com/onthegomap/planetiler/basemap/Generate.java +++ b/planetiler-basemap/src/main/java/com/onthegomap/planetiler/basemap/Generate.java @@ -128,7 +128,7 @@ static JsonNode parseYaml(String string) { public static void main(String[] args) throws IOException { Arguments arguments = Arguments.fromArgsOrConfigFile(args); PlanetilerConfig planetilerConfig = PlanetilerConfig.from(arguments); - String tag = arguments.getString("tag", "openmaptiles tag to use", "v3.12.2"); + String tag = arguments.getString("tag", "openmaptiles tag to use", "v3.13"); String baseUrl = arguments.getString("base-url", "the url used to download the openmaptiles.yml", "https://raw.githubusercontent.com/openmaptiles/openmaptiles/"); String base = baseUrl + tag + "/"; From 579955c388e7ddca98095c63ac13d3cff6476c89 Mon Sep 17 00:00:00 2001 From: boldtrn Date: Thu, 24 Mar 2022 14:01:53 +0100 Subject: [PATCH 4/4] Update README.md --- planetiler-basemap/README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/planetiler-basemap/README.md b/planetiler-basemap/README.md index 49ac0bcfa4..c940b6d435 100644 --- a/planetiler-basemap/README.md +++ b/planetiler-basemap/README.md @@ -41,11 +41,17 @@ To run `Generate.java`, use [scripts/regenerate-openmaptiles.sh](../scripts/rege OpenMapTiles release tag: ```bash -./scripts/regenerate-openmaptiles.sh v3.13 https://raw.githubusercontent.com/openmaptiles/openmaptiles/ +./scripts/regenerate-openmaptiles.sh v3.13 ``` Then follow the instructions it prints for reformatting generated code. +If you want to regenerate from a different repository than the default openmaptiles, you can specify the url like this: + +```bash +./scripts/regenerate-openmaptiles.sh v3.13 https://raw.githubusercontent.com/openmaptiles/openmaptiles/ +``` + ## License and Attribution OpenMapTiles code is licensed under the BSD 3-Clause License, which appears at the top of any file ported from