Skip to content

Commit

Permalink
java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
msbarry committed Oct 26, 2023
1 parent d53f7fc commit 8145577
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 25 deletions.
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ 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 17 or later. You can download Java manually from [Adoptium](https://adoptium.net/installation.html) or
- Install Java 21 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`,
or `port install openjdk17-temurin`)
- [Linux installer](https://adoptium.net/installation/linux/) (or `apt-get install openjdk-17-jdk`)
or `port install openjdk21-temurin`)
- [Linux installer](https://adoptium.net/installation/linux/) (or `apt-get install openjdk-21-jdk`)
- Build and run the tests ([mvnw](https://github.com/takari/maven-wrapper) automatically downloads maven the first time
you run it):
- on mac/linux: `./mvnw clean test`
Expand Down Expand Up @@ -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 17 or later
- If you see a "Project JDK is not defined" error, then choose `Setup SDK` and point IntelliJ at the Java 21 or later
installed on your system
### Visual Studio Code
Expand Down
8 changes: 4 additions & 4 deletions PLANET.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
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 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`
Java 21 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
vCPUs ([referral link](https://m.do.co/c/a947e99aab25)) and OpenJDK 21 installed through `apt`. Planetiler splits work
among available CPUs so the more you have, the less time it takes.

### 1) Choose the Data Source
Expand Down Expand Up @@ -84,10 +84,10 @@ To generate the tiles shown on https://onthegomap.github.io/planetiler-demo/ I u
S3 snapshot, then ran Planetiler on a Digital Ocean Memory-Optimized droplet with 16 CPUs, 128GB RAM, and 1.17TB disk
running Ubuntu 21.04 x64 in the nyc3 location.

First, I installed java 17 jre and screen:
First, I installed java 21 jre and screen:

```bash
apt-get update && apt-get install -y openjdk-17-jre-headless screen
apt-get update && apt-get install -y openjdk-21-jre-headless screen
```

Then I added a script `runworld.sh` to run with 100GB of RAM:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,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 17+ (see [CONTRIBUTING.md](CONTRIBUTING.md)) or [Docker](https://docs.docker.com/get-docker/)
- Java 21+ (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

Expand Down Expand Up @@ -162,7 +162,7 @@ consider [contributing](#contributing) your change back for others to use!

Some example runtimes for the OpenMapTiles profile (excluding downloading resources):

| Input | Version | Machine | Time | mbtiles size | Logs |
| Input | Version | Machine | Time | mbtiles size | Logs |
|-------------------------------------------------------------------------------------------------------------------------------------------|---------|---------------------------------|---------------------------------|--------------|------------------------------------------------------------------------------------------------------------------------|
| s3://osm-pds/2022/planet-220530.osm.pbf (69GB) | 0.5.0 | c2d-standard-112 (112cpu/448GB) | 37m cpu:48h5m gc:3m45s avg:76.9 | 79GB | [logs](planet-logs/v0.5.0-planet-c2d-standard-112.txt) |
| s3://osm-pds/2022/planet-220530.osm.pbf (69GB) | 0.5.0 | c6gd.16xlarge (64cpu/128GB) | 53m cpu:41h58m avg:47.1 | 79GB | [logs](planet-logs/v0.5.0-planet-c6gd-128gb.txt), [VisualVM Profile](planet-logs/v0.5.0-planet-c6gd-128gb.nps) |
Expand All @@ -173,7 +173,7 @@ Some example runtimes for the OpenMapTiles profile (excluding downloading resour

Merging nearby buildings at z13 is very expensive, when run with `--building-merge-z13=false`:

| Input | Version | Machine | Time | mbtiles size | Logs |
| Input | Version | Machine | Time | mbtiles size | Logs |
|------------------------------------------------|---------|----------------------------------------------------------|--------------------------|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|
| s3://osm-pds/2022/planet-220530.osm.pbf (69GB) | 0.5.0 | c2d-standard-112 (112cpu/448GB) | 26m cpu:27h47m avg:63.9 | 79GB | [logs](planet-logs/v0.5.0-planet-c2d-standard-112-no-z13-building-merge.txt) |
| s3://osm-pds/2022/planet-220530.osm.pbf (69GB) | 0.5.0 | c6gd.16xlarge (64cpu/128GB) | 39m cpu:27h4m avg:42.1 | 79GB | [logs](planet-logs/v0.5.0-planet-c6gd-128gb-no-z13-building-merge.txt), [VisualVM Profile](planet-logs/v0.5.0-planet-c6gd-128gb-no-z13-building-merge.nps) |
Expand Down
12 changes: 8 additions & 4 deletions planetiler-custommap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ to regenerate:

cat planetiler-custommap/planetiler.schema.json | jq -r '.properties.args.properties | to_entries[] | "- `" + .key + "` - " + .value.description' | pbcopy
-->

- `threads` - Default number of threads to use.
- `write_threads` - Default number of threads to use when writing temp features
- `process_threads` - Default number of threads to use when processing input features
Expand Down Expand Up @@ -292,15 +293,18 @@ Specific tile post processing operations for merging features may be defined:

- `merge_line_strings` - Combines linestrings with the same set of attributes into a multilinestring where segments with
touching endpoints are merged.
- `merge_polygons` - Combines polygons with the same set of attributes into a multipolygon where overlapping/touching polygons
- `merge_polygons` - Combines polygons with the same set of attributes into a multipolygon where overlapping/touching
polygons
are combined into fewer polygons covering the same area.

The follow attributes for `merge_line_strings` may be set:

- `min_length` - Minimum tile pixel length of features to emit, or 0 to emit all merged linestrings.
- `tolerance` - After merging, simplify linestrings using this pixel tolerance, or -1 to skip simplification step.
- `buffer` - Number of pixels outside the visible tile area to include detail for, or -1 to skip clipping step.

The follow attribute for `merge_polygons` may be set:

- `min_area` - Minimum area in square tile pixels of polygons to emit.

For example:
Expand Down Expand Up @@ -476,7 +480,7 @@ nested, so each child context can also access the variables from its parent.
>> ##### process feature context
>>
>> Context available when processing an input feature, for example testing whether to include it from `include_when`.
>> Available variables:
> > Available variables:
>>
>> - `feature.tags` - map with key/value tags from the input feature
>> - `feature.id` - numeric ID of the input feature
Expand All @@ -493,7 +497,7 @@ nested, so each child context can also access the variables from its parent.
>>>> ##### configure attribute context
>>>>
>>>> Context available after the value of an attribute has been computed, for example: set min zoom to render an
>>>> attribute. Adds variables:
> > > > attribute. Adds variables:
>>>>
>>>> - `value` the value that was computed for this key

Expand Down Expand Up @@ -534,7 +538,7 @@ in [PlanetilerStdLib](src/main/java/com/onthegomap/planetiler/custommap/expressi
- `<string>.replace(from, to, limit)` returns the input string with the first N occurrences of from replaced by to
- `<string>.replaceRegex(pattern, value)` replaces every occurrence of regular expression with value from the string
it was called on using java's
built-in [replaceAll](<https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/regex/Matcher.html#replaceAll(java.lang.String)>)
built-in [replaceAll](<https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/regex/Matcher.html#replaceAll(java.lang.String)>)
behavior
- `<string>.split(separator)` returns a list of strings split from the input by a separator
- `<string>.split(separator, limit)` splits the list into up to N parts
Expand Down
2 changes: 1 addition & 1 deletion planetiler-dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<skip>false</skip>
<from>
<image>
eclipse-temurin:17-jre
eclipse-temurin:21-jre
</image>
<platforms>
<platform>
Expand Down
2 changes: 1 addition & 1 deletion planetiler-examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This is a minimal example project that shows how to create custom maps with Plan

Requirements:

- Java 17+ (see [CONTIRBUTING.md](../CONTRIBUTING.md))
- Java 21+ (see [CONTIRBUTING.md](../CONTRIBUTING.md))
- on mac: `brew install --cask temurin`
- [Maven](https://maven.apache.org/install.html)
- on mac: `brew install maven`
Expand Down
4 changes: 2 additions & 2 deletions planetiler-examples/standalone.pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<planetiler.version>0.7-SNAPSHOT</planetiler.version>
<junit.version>5.10.0</junit.version>
<!-- Replace this with the main class for the profile you add -->
Expand Down
20 changes: 15 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.source.excludeResources>true</maven.source.excludeResources>
<jackson.version>2.15.3</jackson.version>
<junit.version>5.10.0</junit.version>
Expand Down Expand Up @@ -203,7 +203,7 @@
</execution>
</executions>
</plugin>
<!-- require building with jdk 17 -->
<!-- require building with jdk 21 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
Expand All @@ -217,7 +217,7 @@
<configuration>
<rules>
<requireJavaVersion>
<version>17</version>
<version>21</version>
</requireJavaVersion>
</rules>
</configuration>
Expand Down Expand Up @@ -245,8 +245,18 @@
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<compilerArgs>
<arg>-proc:full</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>

<pluginManagement>
<plugins>
<plugin>
Expand Down

0 comments on commit 8145577

Please sign in to comment.