Skip to content

Commit

Permalink
Merge branch 'main' into osm-ids
Browse files Browse the repository at this point in the history
  • Loading branch information
msbarry committed Jun 28, 2024
2 parents f8a8f8d + 07afc77 commit 825b873
Show file tree
Hide file tree
Showing 126 changed files with 8,894 additions and 947 deletions.
66 changes: 33 additions & 33 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,36 @@

version: 2
updates:
- package-ecosystem: maven
directory: "/"
open-pull-requests-limit: 1
schedule:
interval: daily
time: "04:30"
timezone: America/New_York
labels:
- dependencies
ignore:
- dependency-name: "com.google.protobuf:protobuf-java"
versions: [ "3.23.3" ]
- package-ecosystem: maven
# workaround for non-standard pom.xml filename (https://github.com/dependabot/dependabot-core/issues/4425)
directory: "/.github/planetiler-examples-dependabot"
open-pull-requests-limit: 1
schedule:
interval: daily
time: "04:30"
timezone: America/New_York
labels:
- dependencies
ignore:
- dependency-name: "com.onthegomap.planetiler:*"
- package-ecosystem: github-actions
directory: "/"
open-pull-requests-limit: 1
schedule:
interval: daily
time: "04:30"
timezone: America/New_York
labels:
- dependencies
- package-ecosystem: maven
directory: "/"
open-pull-requests-limit: 1
schedule:
interval: daily
time: "04:25"
timezone: America/New_York
labels:
- dependencies
ignore:
- dependency-name: "com.google.protobuf:protobuf-java"
versions: [ "3.23.3" ]
- package-ecosystem: maven
# workaround for non-standard pom.xml filename (https://github.com/dependabot/dependabot-core/issues/4425)
directory: "/.github/planetiler-examples-dependabot"
open-pull-requests-limit: 1
schedule:
interval: daily
time: "04:30"
timezone: America/New_York
labels:
- dependencies
ignore:
- dependency-name: "com.onthegomap.planetiler:*"
- package-ecosystem: github-actions
directory: "/"
open-pull-requests-limit: 1
schedule:
interval: daily
time: "04:30"
timezone: America/New_York
labels:
- dependencies
4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ jobs:
# 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
run: ./mvnw ${{matrix.args}} -Dspotless.check.skip --batch-mode -no-transfer-progress 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
run: mvnw.cmd ${{matrix.args}} -Dspotless.check.skip --batch-mode -no-transfer-progress verify jib:buildTar --file pom.xml
shell: cmd

examples:
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
gpg-passphrase: OSSRH_GPG_SECRET_KEY_PASSWORD

- name: Check tag does not exist yet
run: if git rev-list "v${{ github.event.inputs.version }}"; then echo "Tag already exists. Aborting the release process."; exit 1; fi
Expand All @@ -59,11 +61,8 @@ jobs:
- run: mv planetiler-dist/target/*with-deps.jar planetiler.jar
- run: sha256sum planetiler.jar > planetiler.jar.sha256
- run: md5sum planetiler.jar > planetiler.jar.md5
- name: Install GPG Private Key
run: |
echo -n "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | base64 --decode | gpg --batch --import
- name: Create Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
fail_on_unmatched_files: true
tag_name: v${{ github.event.inputs.version }}
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
gpg-passphrase: OSSRH_GPG_SECRET_KEY_PASSWORD
- run: ./scripts/build-release.sh
- run: ./scripts/test-release.sh
- run: sha256sum planetiler-dist/target/*with-deps.jar
Expand All @@ -44,9 +46,6 @@ jobs:
with:
name: planetiler-build
path: planetiler-dist/target/*with-deps.jar
- name: Install GPG Private Key
run: |
echo -n "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | base64 --decode | gpg --batch --import
- run: ./scripts/push-release.sh
env:
GITHUB_ACTOR: ${{ github.actor }}
Expand Down
122 changes: 55 additions & 67 deletions .github/workflows/update-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_run:
workflows: [ "Performance" ]
types:
- completed
- completed

jobs:
updatepr:
Expand All @@ -16,75 +16,63 @@ jobs:
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
timeout-minutes: 5
steps:
# report status back to pull request
- uses: haya14busa/action-workflow_run-status@v1
- uses: actions/checkout@v4
with:
submodules: true
- name: 'Download branch build info'
uses: dawidd6/action-download-artifact@v3
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}
name: build-info
path: build-info
- name: 'Get build info'
id: build_info
run: echo "::set-output name=pr_number::$(cat build-info/pull_request_number)"
- name: 'Build comment-body'
run: |
cat build-info/branchlogs.txt | sed -n '/^.*Tile stats/,$p' > branchsummary.txt
cat build-info/branchlogs.txt | sed -n '/^.*Exception in thread/,$p' >> branchsummary.txt
cat build-info/baselogs.txt | sed -n '/^.*Tile stats:/,$p' > basesummary.txt
cat build-info/baselogs.txt | sed -n '/^.*Exception in thread/,$p' >> basesummary.txt
# report status back to pull request
- uses: haya14busa/action-workflow_run-status@v1
- uses: actions/checkout@v4
with:
submodules: true
- name: 'Download branch build info'
uses: dawidd6/action-download-artifact@v6
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}
name: build-info
path: build-info
- name: 'Get build info'
id: build_info
run: echo "::set-output name=pr_number::$(cat build-info/pull_request_number)"
- name: 'Build comment-body'
run: |
cat build-info/branchlogs.txt | sed -n '/^.*Tile stats/,/\tfeatures\t/p' > branchsummary.txt
cat build-info/branchlogs.txt | sed -n '/^.*Exception in thread/,$p' >> branchsummary.txt
cat build-info/branchlogs.txt | grep run.jar >> branchsummary.txt
cat build-info/baselogs.txt | sed -n '/^.*Tile stats/,/\tfeatures\t/p' > basesummary.txt
cat build-info/baselogs.txt | sed -n '/^.*Exception in thread/,$p' >> basesummary.txt
cat build-info/baselogs.txt | grep run.jar >> basesummary.txt
cat << EOF > comment-body.txt
<table>
<thead>
<tr>
<th>Base $(cat build-info/base_sha)</th>
<th>This Branch $(cat build-info/branch_sha)</th>
</tr>
</thead>
<tr>
<td>
cat << EOF > comment-body.txt
<table>
<thead>
<tr>
<th>This Branch $(cat build-info/branch_sha)</th>
<th>Base $(cat build-info/base_sha)</th>
</tr>
</thead>
<tr>
<td>
\`\`\`
$(cat basesummary.txt)
\`\`\`
</td>
<td>
\`\`\`
$(cat branchsummary.txt)
\`\`\`
</td>
<td>
\`\`\`
$(cat build-info/branchlogs.txt | sed -n '/^.*Tile stats:/,$p')
\`\`\`
</td>
</tr>
</table>
\`\`\`
$(cat basesummary.txt)
\`\`\`
</td>
</tr>
</table>
https://github.com/onthegomap/planetiler/actions/runs/${{ github.event.workflow_run.id }}
Full logs: https://github.com/onthegomap/planetiler/actions/runs/${{ github.event.workflow_run.id }}
EOF
<details><summary>ℹ️ <strong>Base Logs $(cat build-info/base_sha)</strong></summary>
- name: 'Dump comment body'
run: cat comment-body.txt

\`\`\`
$(cat build-info/baselogs.txt)
\`\`\`
</details>
<details><summary>ℹ️ <strong>This Branch Logs $(cat build-info/branch_sha)</strong></summary>
\`\`\`
$(cat build-info/branchlogs.txt)
\`\`\`
</details>
EOF
- name: 'Dump comment body'
run: cat comment-body.txt

- uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
path: comment-body.txt
header: performance-tests
number: ${{ steps.build_info.outputs.pr_number }}
- uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
path: comment-body.txt
header: performance-tests
number: ${{ steps.build_info.outputs.pr_number }}
3 changes: 3 additions & 0 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The `planetiler-core` module includes the following software:
, [EPSG](https://github.com/geotools/geotools/blob/main/licenses/EPSG.md))
- org.msgpack:msgpack-core (Apache license)
- org.xerial:sqlite-jdbc (Apache license)
- org.xerial.snappy:snappy-java (Apache license)
- com.ibm.icu:icu4j ([ICU license](https://github.com/unicode-org/icu/blob/main/icu4c/LICENSE))
- com.google.guava:guava (Apache license)
- com.google.protobuf:protobuf-java (BSD 3-Clause License)
Expand All @@ -29,6 +30,7 @@ The `planetiler-core` module includes the following software:
- org.snakeyaml:snakeyaml-engine (Apache license)
- org.commonmark:commonmark (BSD 2-clause license)
- org.tukaani:xz (public domain)
- blue.strategic.parquet:parquet-floor (Apache license)
- Adapted code:
- `DouglasPeuckerSimplifier` from [JTS](https://github.com/locationtech/jts) (EDL)
- `OsmMultipolygon` from [imposm3](https://github.com/omniscale/imposm3) (Apache license)
Expand Down Expand Up @@ -65,4 +67,5 @@ The `planetiler-core` module includes the following software:
| OSM Lakelines | [MIT](https://github.com/lukasmartinelli/osm-lakelines), data from OSM [ODBL](https://www.openstreetmap.org/copyright) | yes | no |
| OSM Water Polygons | [acknowledgement](https://osmdata.openstreetmap.de/info/license.html), data from OSM [ODBL](https://www.openstreetmap.org/copyright) | yes | yes |
| Wikidata name translations | [CCO](https://www.wikidata.org/wiki/Wikidata:Licensing) | no | no |
| Overture Maps | [Various](https://docs.overturemaps.org/attribution) | no | yes |

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ Planetiler is made possible by these awesome open source projects:
Google's [Common Expression Language](https://github.com/google/cel-spec) that powers dynamic expressions embedded in
schema config files.
- [PMTiles](https://github.com/protomaps/PMTiles) optimized tile storage format
- [Apache Parquet](https://github.com/apache/parquet-mr) to support reading geoparquet files in java (with dependencies
minimized by [parquet-floor](https://github.com/strategicblue/parquet-floor))

See [NOTICE.md](NOTICE.md) for a full list and license details.

Expand Down
2 changes: 1 addition & 1 deletion planetiler-benchmarks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.6.0</version>
<version>3.7.1</version>
<!-- for with-deps assembly descriptor -->
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package com.onthegomap.planetiler.benchmarks;

import com.onthegomap.planetiler.geo.LineSplitter;
import java.util.concurrent.ThreadLocalRandom;
import org.locationtech.jts.util.GeometricShapeFactory;

public class BenchmarkLineSplitter {

public static void main(String[] args) {
for (int i = 0; i < 10; i++) {
System.err.println(
"reused:\t" +
timeReused(10, 1_000_000) + "\t" +
timeReused(100, 100_000) + "\t" +
timeReused(1_000, 10_000) +
"\t!reused\t" +
timeNotReused(10, 1_000_000) + "\t" +
timeNotReused(100, 100_000) + "\t" +
timeNotReused(1_000, 10_000) +
"\tcacheable\t" +
timeCacheable(10, 1_000_000) + "\t" +
timeCacheable(100, 100_000) + "\t" +
timeCacheable(1_000, 10_000));
}
}

private static long timeCacheable(int points, int iters) {
var fact = new GeometricShapeFactory();
fact.setNumPoints(points);
fact.setWidth(10);
var shape = fact.createArc(0, Math.PI);
long start = System.currentTimeMillis();
LineSplitter splitter = new LineSplitter(shape);
var random = ThreadLocalRandom.current();
for (int i = 0; i < iters; i++) {
int a = random.nextInt(0, 90);
int b = random.nextInt(a + 2, 100);
splitter.get(a / 100d, b / 100d);
}
return System.currentTimeMillis() - start;
}

private static long timeReused(int points, int iters) {
var fact = new GeometricShapeFactory();
fact.setNumPoints(points);
fact.setWidth(10);
var shape = fact.createArc(0, Math.PI);
long start = System.currentTimeMillis();
LineSplitter splitter = new LineSplitter(shape);
var random = ThreadLocalRandom.current();
for (int i = 0; i < iters; i++) {
var a = random.nextDouble(0, 1);
var b = random.nextDouble(a, 1);
splitter.get(a, b);
}
return System.currentTimeMillis() - start;
}

private static long timeNotReused(int points, int iters) {
var fact = new GeometricShapeFactory();
fact.setNumPoints(points);
fact.setWidth(10);
var shape = fact.createArc(0, Math.PI);
long start = System.currentTimeMillis();
var random = ThreadLocalRandom.current();
for (int i = 0; i < iters; i++) {
LineSplitter splitter = new LineSplitter(shape);
var a = random.nextDouble(0, 1);
var b = random.nextDouble(a, 1);
splitter.get(a, b);
}
return System.currentTimeMillis() - start;
}
}
Loading

0 comments on commit 825b873

Please sign in to comment.