Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow changing Basemap Base-Url #143

Merged
merged 4 commits into from
Mar 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions planetiler-basemap/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -41,11 +41,17 @@ 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
```

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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,10 @@ 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 base = "https://raw.githubusercontent.com/openmaptiles/openmaptiles/" + tag + "/";
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 + "/";
msbarry marked this conversation as resolved.
Show resolved Hide resolved

// start crawling from openmaptiles.yaml
// then crawl schema from each layers/<layer>/<layer>.yaml file that it references
Expand Down
5 changes: 4 additions & 1 deletion scripts/regenerate-openmaptiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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