diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index b7e5a78b..1dc859cd 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -15,17 +15,17 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 steps: - - uses: actions/checkout@v3 - with: - submodules: true - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: 17 - distribution: 'temurin' - cache: 'maven' - - name: Ensure code formatted with mvn spotless:apply - run: ./mvnw -DskipTests --batch-mode -no-transfer-progress spotless:check + - uses: actions/checkout@v3 + with: + submodules: true + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'temurin' + cache: 'maven' + - name: Ensure code formatted with mvn spotless:apply + run: ./mvnw -DskipTests --batch-mode -no-transfer-progress spotless:check build: name: Java ${{ matrix.jdk }} / ${{ matrix.os }} ${{ matrix.args }} @@ -36,33 +36,33 @@ jobs: os: [ ubuntu-latest, macos-latest, windows-latest ] jdk: [ 17 ] include: - - os: ubuntu-latest - jdk: 16 - - os: ubuntu-latest - jdk: 18 - - os: ubuntu-latest - jdk: 17 - args: "-DargLine='-Duser.language=fr -Duser.country=FR'" + - os: ubuntu-latest + jdk: 17 + args: "-DargLine='-Duser.language=fr -Duser.country=FR'" + - os: ubuntu-latest + jdk: 18 + - os: ubuntu-latest + jdk: 19 runs-on: ${{ matrix.os }} timeout-minutes: 15 steps: - - uses: actions/checkout@v3 - with: - submodules: true - - name: Set up JDK ${{ matrix.jdk }} - uses: actions/setup-java@v3 - with: - java-version: ${{ matrix.jdk }} - distribution: 'temurin' - cache: 'maven' - # Skip spotless since that gets checked in a separate task - - name: Build with mvnw (linux/mac) - if: ${{ !contains(matrix.os, 'windows') }} - run: ./mvnw ${{matrix.args}} -Dspotless.check.skip --batch-mode -no-transfer-progress package verify jib:buildTar --file pom.xml - - name: Build with mvnw.cmd (windows) - if: ${{ contains(matrix.os, 'windows') }} - run: mvnw.cmd ${{matrix.args}} -Dspotless.check.skip --batch-mode -no-transfer-progress package verify jib:buildTar --file pom.xml - shell: cmd + - uses: actions/checkout@v3 + with: + submodules: true + - name: Set up JDK ${{ matrix.jdk }} + uses: actions/setup-java@v3 + with: + java-version: ${{ matrix.jdk }} + distribution: 'temurin' + cache: 'maven' + # Skip spotless since that gets checked in a separate task + - name: Build with mvnw (linux/mac) + if: ${{ !contains(matrix.os, 'windows') }} + run: ./mvnw ${{matrix.args}} -Dspotless.check.skip --batch-mode -no-transfer-progress package verify jib:buildTar --file pom.xml + - name: Build with mvnw.cmd (windows) + if: ${{ contains(matrix.os, 'windows') }} + run: mvnw.cmd ${{matrix.args}} -Dspotless.check.skip --batch-mode -no-transfer-progress package verify jib:buildTar --file pom.xml + shell: cmd examples: name: Example project @@ -70,85 +70,85 @@ jobs: timeout-minutes: 15 continue-on-error: true steps: - - uses: actions/checkout@v3 - with: - submodules: true - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: 17 - distribution: 'temurin' - - name: Build and test - run: mvn --batch-mode -no-transfer-progress package --file standalone.pom.xml - working-directory: planetiler-examples - - name: Find jar - run: mv target/*with-deps.jar ./run.jar - working-directory: planetiler-examples - - name: Run - run: java -jar run.jar --osm-path=../planetiler-core/src/test/resources/monaco-latest.osm.pbf --mbtiles=data/out.mbtiles - working-directory: planetiler-examples - - name: Verify - run: java -cp run.jar com.onthegomap.planetiler.mbtiles.Verify data/out.mbtiles - working-directory: planetiler-examples + - uses: actions/checkout@v3 + with: + submodules: true + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'temurin' + - name: Build and test + run: mvn --batch-mode -no-transfer-progress package --file standalone.pom.xml + working-directory: planetiler-examples + - name: Find jar + run: mv target/*with-deps.jar ./run.jar + working-directory: planetiler-examples + - name: Run + run: java -jar run.jar --osm-path=../planetiler-core/src/test/resources/monaco-latest.osm.pbf --mbtiles=data/out.mbtiles + working-directory: planetiler-examples + - name: Verify + run: java -cp run.jar com.onthegomap.planetiler.mbtiles.Verify data/out.mbtiles + working-directory: planetiler-examples run: name: Build / Run runs-on: ubuntu-latest timeout-minutes: 15 steps: - - uses: actions/checkout@v3 - with: - submodules: true - - name: Cache data/sources - uses: ./.github/cache-sources-action - - name: Set up JDK - uses: actions/setup-java@v3 - with: - java-version: 17 - distribution: 'temurin' - cache: 'maven' + - uses: actions/checkout@v3 + with: + submodules: true + - name: Cache data/sources + uses: ./.github/cache-sources-action + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'temurin' + cache: 'maven' - - name: Build this branch - run: ./mvnw -DskipTests -Dimage.version=CI_ONLY --batch-mode -no-transfer-progress package jib:dockerBuild --file pom.xml + - name: Build this branch + run: ./mvnw -DskipTests -Dimage.version=CI_ONLY --batch-mode -no-transfer-progress package jib:dockerBuild --file pom.xml - - name: 'Upload artifact' - uses: actions/upload-artifact@v3 - with: - name: planetiler-build - path: planetiler-dist/target/*with-deps.jar + - name: 'Upload artifact' + uses: actions/upload-artifact@v3 + with: + name: planetiler-build + path: planetiler-dist/target/*with-deps.jar - - name: Download data (java) - run: java -jar planetiler-dist/target/*with-deps.jar --only-download --area=monaco + - name: Download data (java) + run: java -jar planetiler-dist/target/*with-deps.jar --only-download --area=monaco - - name: Download wikidata (java) - run: java -jar planetiler-dist/target/*with-deps.jar --only-fetch-wikidata --area=monaco + - name: Download wikidata (java) + run: java -jar planetiler-dist/target/*with-deps.jar --only-fetch-wikidata --area=monaco - - name: Verify build - run: ./scripts/test-release.sh CI_ONLY - env: - SKIP_EXAMPLE_PROJECT: true + - name: Verify build + run: ./scripts/test-release.sh CI_ONLY + env: + SKIP_EXAMPLE_PROJECT: true quickstart: name: Quickstart script runs-on: ubuntu-latest timeout-minutes: 15 steps: - - uses: actions/checkout@v3 - with: - submodules: true - - name: Cache data/sources - uses: ./.github/cache-sources-action - - name: Set up JDK - uses: actions/setup-java@v3 - with: - java-version: 17 - distribution: 'temurin' - cache: 'maven' + - uses: actions/checkout@v3 + with: + submodules: true + - name: Cache data/sources + uses: ./.github/cache-sources-action + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'temurin' + cache: 'maven' - - name: quickstart.sh --build - run: rm -rf data/output.mbtiles data/tmp && ./quickstart.sh monaco --build && ./scripts/check-monaco.sh data/output.mbtiles - - name: quickstart.sh --jar - run: rm -rf data/output.mbtiles data/tmp && ./quickstart.sh monaco --jar && ./scripts/check-monaco.sh data/output.mbtiles - # run docker last since it creates temp dirs with root user - - name: quickstart.sh --docker - run: rm -rf data/output.mbtiles data/tmp && ./quickstart.sh monaco --docker && ./scripts/check-monaco.sh data/output.mbtiles + - name: quickstart.sh --build + run: rm -rf data/output.mbtiles data/tmp && ./quickstart.sh monaco --build && ./scripts/check-monaco.sh data/output.mbtiles + - name: quickstart.sh --jar + run: rm -rf data/output.mbtiles data/tmp && ./quickstart.sh monaco --jar && ./scripts/check-monaco.sh data/output.mbtiles + # run docker last since it creates temp dirs with root user + - name: quickstart.sh --docker + run: rm -rf data/output.mbtiles data/tmp && ./quickstart.sh monaco --docker && ./scripts/check-monaco.sh data/output.mbtiles diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bccb4dd2..969ad6c7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,7 +11,7 @@ Pull requests are welcome! Any pull request should: To set up your local development environment: - Fork the repo [setup submodules](README.md#git-submodules) -- Install Java 16 or later. You can download Java manually from [Adoptium](https://adoptium.net/installation.html) or +- Install Java 17 or later. You can download Java manually from [Adoptium](https://adoptium.net/installation.html) or use: - [Windows installer](https://adoptium.net/installation.html#windows-msi) - [macOS installer](https://adoptium.net/installation.html#macos-pkg) (or `brew install --cask temurin`, @@ -54,7 +54,7 @@ Troubleshooting: - If any java source files show "Cannot resolve symbol..." errors for Planetiler classes, you might need to select: `File -> Invalidate Caches... -> Just Restart`. -- If you see a "Project JDK is not defined" error, then choose `Setup SDK` and point IntelliJ at the Java 16 or later +- If you see a "Project JDK is not defined" error, then choose `Setup SDK` and point IntelliJ at the Java 17 or later installed on your system ### Visual Studio Code diff --git a/PLANET.md b/PLANET.md index 1a3b97f2..1fd9d4cc 100644 --- a/PLANET.md +++ b/PLANET.md @@ -1,8 +1,9 @@ # Generating a Map of the World -To generate a map of the world using the built-in [OpenMapTiles profile](https://github.com/openmaptiles/planetiler-openmaptiles), you will need a +To generate a map of the world using the +built-in [OpenMapTiles profile](https://github.com/openmaptiles/planetiler-openmaptiles), you will need a machine with -Java 16 or later installed and at least 10x as much disk space and at least 0.5x as much RAM as the `planet.osm.pbf` +Java 17 or later installed and at least 10x as much disk space and at least 0.5x as much RAM as the `planet.osm.pbf` file you start from. All testing has been done using Digital Ocean droplets with dedicated vCPUs ([referral link](https://m.do.co/c/a947e99aab25)) and OpenJDK 17 installed through `apt`. Planetiler splits work among available CPUs so the more you have, the less time it takes. @@ -21,7 +22,8 @@ First decide where to get the `planet.osm.pbf` file: osmium apply-changes daylight.osm.pbf admin.osc.bz2 -o everything.osm.pbf osmium renumber everything.osm.pbf -o planet.osm.pbf ``` -- If you would like to update your `planet.osm.pbf` file to the latest changes from OpenStreetMap, you can use [pyosmium-up-to-date](https://docs.osmcode.org/pyosmium/latest/tools_uptodate.html): +- If you would like to update your `planet.osm.pbf` file to the latest changes from OpenStreetMap, you can + use [pyosmium-up-to-date](https://docs.osmcode.org/pyosmium/latest/tools_uptodate.html): ```bash pyosmium-up-to-date --size 20000 -v planet.osm.pbf diff --git a/README.md b/README.md index d533eba3..2d6303c0 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ the [OpenStreetMap Americana Project](https://github.com/ZeLonewolf/openstreetma To generate a map of an area using the [OpenMapTiles profile](https://github.com/openmaptiles/planetiler-openmaptiles), you will need: -- Java 16+ (see [CONTRIBUTING.md](CONTRIBUTING.md)) or [Docker](https://docs.docker.com/get-docker/) +- Java 17+ (see [CONTRIBUTING.md](CONTRIBUTING.md)) or [Docker](https://docs.docker.com/get-docker/) - at least 1GB of free disk space plus 5-10x the size of the `.osm.pbf` file - at least 0.5x as much free RAM as the input `.osm.pbf` file size diff --git a/planetiler-examples/README.md b/planetiler-examples/README.md index 176e3d63..3978b59d 100644 --- a/planetiler-examples/README.md +++ b/planetiler-examples/README.md @@ -4,7 +4,7 @@ This is a minimal example project that shows how to create custom maps with Plan Requirements: -- Java 16+ (see [CONTIRBUTING.md](../CONTRIBUTING.md)) +- Java 17+ (see [CONTIRBUTING.md](../CONTRIBUTING.md)) - on mac: `brew install --cask temurin` - [Maven](https://maven.apache.org/install.html) - on mac: `brew install maven` diff --git a/planetiler-examples/standalone.pom.xml b/planetiler-examples/standalone.pom.xml index 628f1f84..7aec7fdc 100644 --- a/planetiler-examples/standalone.pom.xml +++ b/planetiler-examples/standalone.pom.xml @@ -9,8 +9,8 @@ UTF-8 - 16 - 16 + 17 + 17 0.6-SNAPSHOT 5.9.2 diff --git a/pom.xml b/pom.xml index 5416af75..9f00eb74 100644 --- a/pom.xml +++ b/pom.xml @@ -17,8 +17,8 @@ UTF-8 - 16 - 16 + 17 + 17 true 2.14.2 5.9.2 @@ -203,7 +203,7 @@ - + org.apache.maven.plugins maven-enforcer-plugin @@ -217,7 +217,7 @@ - 16 + 17 diff --git a/quickstart.sh b/quickstart.sh index 0c298ab6..de0911f9 100755 --- a/quickstart.sh +++ b/quickstart.sh @@ -116,7 +116,7 @@ function check_java_version() { else OUTPUT="$($JAVA -jar "$1" --help 2>&1 || echo OK)" if [[ "$OUTPUT" =~ "UnsupportedClassVersionError" ]]; then - echo "Wrong version of java installed, need at least 16 but found:" + echo "Wrong version of java installed, need at least 17 but found:" $JAVA --version exit 1 fi