-
-
Notifications
You must be signed in to change notification settings - Fork 153
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When opening a GeoPackage with a compound CRS which has a horizontal CRS and a vertical CRS, like for example EPSG:5847, planetiler crashes.
To Reproduce
Steps to reproduce the behavior:
-
Download this file and store it as
se.gpkg: se.gpkg.txt -
Create a Power.java file like this:
// Power.java
import java.nio.file.Path;
import java.io.IOException;
import java.nio.file.*;
import java.util.stream.Stream;
import com.onthegomap.planetiler.FeatureCollector;
import com.onthegomap.planetiler.Planetiler;
import com.onthegomap.planetiler.Profile;
import com.onthegomap.planetiler.config.Arguments;
import com.onthegomap.planetiler.reader.SourceFeature;
public class Power implements Profile {
public static void main(String[] args) {
var arguments = Arguments.fromArgs(args).withDefault("download", true);
String area = arguments.getString("area", "geofabrik area to download", "rhode-island");
Planetiler.create(arguments)
.addGeoPackageSource("se", Path.of("se.gpkg"), null)
.overwriteOutput(Path.of("power.pmtiles"))
.setProfile(new Power())
.run();
}
@Override
public void processFeature(SourceFeature sourceFeature, FeatureCollector features) {
}
@Override
public String attribution() {
return OSM_ATTRIBUTION;
}
@Override
public boolean isOverlay() {
return true;
}
}- Run
java -cp planetiler.jar Power.java - See this error:
➜ repro git:(main) ✗ java -cp planetiler.jar Power.java
0:00:00 DEB - argument: area=rhode-island (geofabrik area to download)
0:00:00 INF - argument: stats=use in-memory stats
0:00:00 DEB - argument: madvise=true (default value for whether to use linux madvise(random) to improve memory-mapped read performance for temporary storage)
0:00:00 DEB - argument: storage=mmap (default storage type for temporary data, one of [ram, mmap, direct])
0:00:00 DEB - argument: threads=32 (num threads)
0:00:00 DEB - argument: write_threads=1 (number of threads to use when writing temp features)
0:00:00 DEB - argument: process_threads=31 (number of threads to use when processing input features)
0:00:00 DEB - argument: bounds=null (bounds)
0:00:00 DEB - argument: polygon=null (a .poly file that limits output to tiles intersecting the shape)
0:00:00 DEB - argument: minzoom=0 (minimum zoom level)
0:00:00 DEB - argument: maxzoom=14 (maximum zoom level up to 15)
0:00:00 DEB - argument: render_maxzoom=14 (maximum rendering zoom level up to 15)
0:00:00 DEB - argument: tmpdir=data/tmp (temp directory)
0:00:00 DEB - argument: extra_name_tags= (Extra name tags to copy from OSM to output)
0:00:00 DEB - argument: feature_read_threads=2 (number of threads to use when reading features at tile write time)
0:00:00 DEB - argument: tile_write_threads=1 (number of threads used to write tiles - only supported by [files, csv, tsv, proto, pbf, json])
0:00:00 DEB - argument: loginterval=10 seconds (time between logs)
0:00:00 DEB - argument: force=false (overwriting output file and ignore disk/RAM warnings)
0:00:00 DEB - argument: append=false (append to the output file - only supported by [files, csv, tsv, proto, pbf, json])
0:00:00 DEB - argument: compress_temp=false (compress temporary feature storage (uses more CPU, but less disk space))
0:00:00 DEB - argument: mmap_temp=true (use memory-mapped IO for temp feature files)
0:00:00 DEB - argument: sort_max_readers=6 (maximum number of concurrent read threads to use when sorting chunks)
0:00:00 DEB - argument: sort_max_writers=6 (maximum number of concurrent write threads to use when sorting chunks)
0:00:00 DEB - argument: nodemap_type=sparsearray (type of node location map, one of [noop, sortedtable, sparsearray, array])
0:00:00 DEB - argument: nodemap_storage=mmap (storage for node location map, one of [ram, mmap, direct])
0:00:00 DEB - argument: nodemap_madvise=true (use linux madvise(random) for node locations)
0:00:00 DEB - argument: multipolygon_geometry_storage=mmap (storage for multipolygon geometries, one of [ram, mmap, direct])
0:00:00 DEB - argument: multipolygon_geometry_madvise=true (use linux madvise(random) for temporary multipolygon geometry storage)
0:00:00 DEB - argument: http_user_agent=Planetiler downloader (https://github.com/onthegomap/planetiler) (User-Agent header to set when downloading files over HTTP)
0:00:00 DEB - argument: http_timeout=30 seconds (Timeout to use when downloading files over HTTP)
0:00:00 DEB - argument: http_retries=5 (Retries to use when downloading files over HTTP)
0:00:00 DEB - argument: http_retry_wait=5 seconds (How long to wait before retrying HTTP request)
0:00:00 DEB - argument: download_chunk_size_mb=100 (Size of file chunks to download in parallel in megabytes)
0:00:00 DEB - argument: download_threads=1 (Number of parallel threads to use when downloading each file)
0:00:00 DEB - argument: download_max_bandwidth= (Maximum bandwidth to consume when downloading files in units mb/s, mbps, kbps, etc.)
0:00:00 DEB - argument: min_feature_size_at_max_zoom=0.0625 (Default value for the minimum size in tile pixels of features to emit at the maximum zoom level to allow for overzooming)
0:00:00 DEB - argument: min_feature_size=1.0 (Default value for the minimum size in tile pixels of features to emit below the maximum zoom level)
0:00:00 DEB - argument: simplify_tolerance_at_max_zoom=0.0625 (Default value for the tile pixel tolerance to use when simplifying features at the maximum zoom level to allow for overzooming)
0:00:00 DEB - argument: simplify_tolerance=0.1 (Default value for the tile pixel tolerance to use when simplifying features below the maximum zoom level)
0:00:00 DEB - argument: osm_lazy_reads=true (Read OSM blocks from disk in worker threads)
0:00:00 DEB - argument: skip_filled_tiles=false (Skip writing tiles containing only polygon fills to the output)
0:00:00 DEB - argument: tile_warning_size_mb=1.0 (Maximum size in megabytes of a tile to emit a warning about)
0:00:00 DEB - argument: color=null (Color the terminal output)
0:00:00 DEB - argument: keep_unzipped=false (keep unzipped sources by default after reading)
0:00:00 DEB - argument: tile_compression=gzip (the tile compression, one of [gzip, none])
0:00:00 DEB - argument: output_layerstats=false (output a tsv.gz file for each tile/layer size)
0:00:00 DEB - argument: debug_url=https://onthegomap.github.io/planetiler-demo/#{z}/{lat}/{lon} (debug url to use for displaying tiles with {z} {lat} {lon} placeholders)
0:00:00 DEB - argument: tile_weights=data/tile_weights.tsv.gz (tsv.gz file with columns z,x,y,loads to generate weighted average tile size stat)
0:00:00 DEB - argument: max_point_buffer=Infinity (Additional global limit for the max tile pixels to include points outside tile bounds of all layers. Set to a lower value to reduce tile size for clients that handle label collisions across tiles (most web and native clients). NOTE: Do not reduce if you need to support raster tile rendering)
0:00:00 DEB - argument: log_jts_exceptions=false (Emit verbose details to debug JTS geometry errors)
0:00:00 DEB - argument: feature_source_id_multiplier=10 (Set vector tile feature IDs to (featureId * thisValue) + sourceId where sourceId is 1 for OSM nodes, 2 for ways, 3 for relations, and 0 for other sources. Set to false to disable.)
0:00:00 DEB - argument: only_download=false (download source data then exit)
0:00:00 DEB - argument: tests=null (run test cases in a yaml then quit)
0:00:00 DEB - argument: download=true (download sources)
0:00:00 DEB - argument: refresh_sources=false (download new version of source files if they have changed)
0:00:00 DEB - argument: download_osm_tile_weights=true (download OSM tile weights file)
0:00:00 DEB - argument: temp_nodes=data/tmp/node.db (temp node db location)
0:00:00 DEB - argument: temp_multipolygons=data/tmp/multipolygon.db (temp multipolygon db location)
0:00:00 DEB - argument: temp_features=data/tmp/feature.db (temp feature db location)
0:00:00 DEB - argument: osm_parse_node_bounds=false (parse bounds from OSM nodes instead of header)
0:00:00 DEB - argument: se_path=se.gpkg (se geopackage path)
0:00:00 DEB - argument: refresh_se=false (Download new version of se if changed)
0:00:00 DEB - argument: free_se_after_read=false (delete se input file after reading to make space for output (reduces peak disk usage))
0:00:00 DEB - argument: se_url=null (se geopackage url)
0:00:00 DEB - argument: se_keep_unzipped=false (keep unzipped se after reading)
0:00:00 DEB - argument: output=power.pmtiles (output tile archive URI)
0:00:00 DEB - argument: version=false (show version then exit)
0:00:00 INF - Planetiler build git hash: e6e13811ed69a61c82f3599d1a72d28fa98f6801
0:00:00 INF - Planetiler build version: 0.9.3
0:00:00 INF - Planetiler build timestamp: 2025-10-28T09:50:32.363Z
0:00:00 DEB - argument: help=false (show arguments then exit)
0:00:00 DEB - argument: layer_stats=/home/oliver/mapterhorn/pipelines/coverage/repro/power.pmtiles.layerstats.tsv.gz (layer stats output path)
0:00:00 INF - Building Power profile into file:///home/oliver/mapterhorn/pipelines/coverage/repro/power.pmtiles in these phases:
0:00:00 INF - se: Process features in se.gpkg
0:00:00 INF - sort: Sort rendered features by tile ID
0:00:00 INF - archive: Encode each tile and write to TileArchiveConfig[format=PMTILES, scheme=FILE, uri=file:///home/oliver/mapterhorn/pipelines/coverage/repro/power.pmtiles, options={}]
0:00:00 INF - Downloading pre-computed tile weights from https://raw.githubusercontent.com/onthegomap/planetiler/main/layerstats/top_osm_tiles.tsv.gz to data/tile_weights.tsv.gz
0:00:01 DEB - argument: archive_name=Power ('name' attribute for tileset metadata)
0:00:01 DEB - argument: archive_description=null ('description' attribute for tileset metadata)
0:00:01 DEB - argument: archive_attribution=<a href="https://www.openstreetmap.org/copyright" target="_blank">© OpenStreetMap contributors</a> ('attribution' attribute for tileset metadata)
0:00:01 DEB - argument: archive_version=null ('version' attribute for tileset metadata)
0:00:01 DEB - argument: archive_type=overlay ('type' attribute for tileset metadata)
0:00:01 DEB - argument: archive_format=pbf ('format' attribute for tileset metadata)
0:00:01 INF - Using merge sort feature map, chunk size=2000mb max workers=32
0:00:01 INF [se] -
0:00:01 INF [se] - Starting...
Worker se_read-2 died
org.geotools.api.referencing.operation.OperationNotFoundException: No transformation available from system "CompoundCRS[SWEREF99 TM + RH2000 height]" to "GeographicCRS[WGS 84]".
at org.geotools.referencing.operation.DefaultCoordinateOperationFactory.createOperation(DefaultCoordinateOperationFactory.java:206)
at org.geotools.referencing.operation.BufferedCoordinateOperationFactory.createOperation(BufferedCoordinateOperationFactory.java:222)
at org.geotools.referencing.CRS.findMathTransform(CRS.java:1265)
at com.onthegomap.planetiler.geo.GeoUtils.findMathTransform(GeoUtils.java:684)
at com.onthegomap.planetiler.reader.GeoPackageReader.readFeatures(GeoPackageReader.java:171)
at com.onthegomap.planetiler.reader.SourceFeatureProcessor.lambda$readPaths$3(SourceFeatureProcessor.java:174)
at com.onthegomap.planetiler.worker.WorkerPipeline$Builder.lambda$addWorker$0(WorkerPipeline.java:249)
at com.onthegomap.planetiler.worker.Worker.lambda$new$0(Worker.java:41)
at com.onthegomap.planetiler.worker.Worker.lambda$new$1(Worker.java:68)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
Exception in thread "main" com.onthegomap.planetiler.Planetiler$PlanetilerException: Error occurred during stage se
at com.onthegomap.planetiler.Planetiler.run(Planetiler.java:880)
at Power.main(Power.java:22)
Caused by: com.onthegomap.planetiler.util.Exceptions$FatalPlanetilerException: java.util.concurrent.ExecutionException: com.onthegomap.planetiler.util.Exceptions$FatalPlanetilerException: org.geotools.api.referencing.operation.OperationNotFoundException: No transformation available from system "CompoundCRS[SWEREF99 TM + RH2000 height]" to "GeographicCRS[WGS 84]".
at com.onthegomap.planetiler.util.Exceptions.throwFatalException(Exceptions.java:29)
at com.onthegomap.planetiler.stats.ProgressLoggers.await(ProgressLoggers.java:367)
at com.onthegomap.planetiler.stats.ProgressLoggers.awaitAndLog(ProgressLoggers.java:352)
at com.onthegomap.planetiler.worker.WorkerPipeline.awaitAndLog(WorkerPipeline.java:59)
at com.onthegomap.planetiler.reader.SourceFeatureProcessor.processFiles(SourceFeatureProcessor.java:130)
at com.onthegomap.planetiler.reader.SourceFeatureProcessor.processFiles(SourceFeatureProcessor.java:65)
at com.onthegomap.planetiler.reader.GeoPackageReader.process(GeoPackageReader.java:116)
at com.onthegomap.planetiler.Planetiler.lambda$addGeoPackageSource$4(Planetiler.java:410)
at com.onthegomap.planetiler.Planetiler.lambda$ifSourceUsed$14(Planetiler.java:1006)
at com.onthegomap.planetiler.Planetiler.run(Planetiler.java:878)
at Power.main(Power.java:22)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at jdk.compiler/com.sun.tools.javac.launcher.Main.execute(Main.java:484)
at jdk.compiler/com.sun.tools.javac.launcher.Main.run(Main.java:208)
at jdk.compiler/com.sun.tools.javac.launcher.Main.main(Main.java:135)
Caused by: java.util.concurrent.ExecutionException: com.onthegomap.planetiler.util.Exceptions$FatalPlanetilerException: org.geotools.api.referencing.operation.OperationNotFoundException: No transformation available from system "CompoundCRS[SWEREF99 TM + RH2000 height]" to "GeographicCRS[WGS 84]".
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2096)
at com.onthegomap.planetiler.stats.ProgressLoggers.await(ProgressLoggers.java:361)
... 14 more
Caused by: com.onthegomap.planetiler.util.Exceptions$FatalPlanetilerException: org.geotools.api.referencing.operation.OperationNotFoundException: No transformation available from system "CompoundCRS[SWEREF99 TM + RH2000 height]" to "GeographicCRS[WGS 84]".
at com.onthegomap.planetiler.util.Exceptions.throwFatalException(Exceptions.java:29)
at com.onthegomap.planetiler.worker.Worker.lambda$new$1(Worker.java:76)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: org.geotools.api.referencing.operation.OperationNotFoundException: No transformation available from system "CompoundCRS[SWEREF99 TM + RH2000 height]" to "GeographicCRS[WGS 84]".
at org.geotools.referencing.operation.DefaultCoordinateOperationFactory.createOperation(DefaultCoordinateOperationFactory.java:206)
at org.geotools.referencing.operation.BufferedCoordinateOperationFactory.createOperation(BufferedCoordinateOperationFactory.java:222)
at org.geotools.referencing.CRS.findMathTransform(CRS.java:1265)
at com.onthegomap.planetiler.geo.GeoUtils.findMathTransform(GeoUtils.java:684)
at com.onthegomap.planetiler.reader.GeoPackageReader.readFeatures(GeoPackageReader.java:171)
at com.onthegomap.planetiler.reader.SourceFeatureProcessor.lambda$readPaths$3(SourceFeatureProcessor.java:174)
at com.onthegomap.planetiler.worker.WorkerPipeline$Builder.lambda$addWorker$0(WorkerPipeline.java:249)
at com.onthegomap.planetiler.worker.Worker.lambda$new$0(Worker.java:41)
at com.onthegomap.planetiler.worker.Worker.lambda$new$1(Worker.java:68)
Expected behavior
Should not crash. Maybe it should just ignore the vertical CRS?
Environment (please complete the following information):
- Hardware: https://gist.github.com/wipfli/17e735c79461cf12019d14ac4ed32b67
- OS: Ubuntu
- Java version and distribution:
➜ repro git:(main) ✗ java --version
openjdk 21.0.8 2025-07-15
OpenJDK Runtime Environment (build 21.0.8+9-Ubuntu-0ubuntu124.04.1)
OpenJDK 64-Bit Server VM (build 21.0.8+9-Ubuntu-0ubuntu124.04.1, mixed mode, sharing)
- Maven version: N/A
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working