Skip to content

fix: switch from addNaturalEarthSource to addGeoPackageSource#474

Open
mxzinke wants to merge 3 commits into
protomaps:mainfrom
mxzinke:fix-deprecated-natural-earth-source
Open

fix: switch from addNaturalEarthSource to addGeoPackageSource#474
mxzinke wants to merge 3 commits into
protomaps:mainfrom
mxzinke:fix-deprecated-natural-earth-source

Conversation

@mxzinke

@mxzinke mxzinke commented Apr 28, 2025

Copy link
Copy Markdown
Contributor

addNaturalEarthSource() is deprecated by planetiler and its now recommended to use addGeoPackageSource(). To make this work we need to adjust of this source to the natural_earth_vector.gpkg.zip file from natural earth.

Fixing #470 - @wipfli

addNaturalEarthSource() is deprecated by planetiler and its now recommended to use addGeoPackageSource(). To make this work we need to adjust of this source to the natural_earth_vector.gpkg.zip file from natural earth.
@mxzinke

mxzinke commented Apr 28, 2025

Copy link
Copy Markdown
Contributor Author

Not 100% sure if its related, but it seams like I get this error after the change for some regions:

org.geotools.api.referencing.NoSuchAuthorityCodeException: No code "EPSG:0" from authority "European Petroleum Survey Group" found for object of type "interface org.geotools.api.referencing.crs.CoordinateReferenceSystem".
        at org.geotools.referencing.factory.AbstractAuthorityFactory.noSuchAuthorityCode(AbstractAuthorityFactory.java:908)
        at org.geotools.referencing.factory.epsg.DirectEpsgFactory.createCoordinateReferenceSystem(DirectEpsgFactory.java:2239)
        at org.geotools.referencing.factory.BufferedAuthorityFactory.createCoordinateReferenceSystem(BufferedAuthorityFactory.java:760)
        at org.geotools.referencing.factory.AuthorityFactoryAdapter.createCoordinateReferenceSystem(AuthorityFactoryAdapter.java:812)
        at org.geotools.referencing.factory.FallbackAuthorityFactory.createCoordinateReferenceSystem(FallbackAuthorityFactory.java:653)
        at org.geotools.referencing.factory.AuthorityFactoryAdapter.createCoordinateReferenceSystem(AuthorityFactoryAdapter.java:812)
        at org.geotools.referencing.factory.ThreadedAuthorityFactory.createCoordinateReferenceSystem(ThreadedAuthorityFactory.java:666)
        at org.geotools.referencing.DefaultAuthorityFactory.createCoordinateReferenceSystem(DefaultAuthorityFactory.java:178)
        at org.geotools.referencing.CRS.decode(CRS.java:539)
        at org.geotools.referencing.CRS.decode(CRS.java:460)
        at com.onthegomap.planetiler.reader.GeoPackageReader.readFeatures(GeoPackageReader.java:139)
        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(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
Exception in thread "main" com.onthegomap.planetiler.Planetiler$PlanetilerException: Error occurred during stage ne
        at com.onthegomap.planetiler.Planetiler.run(Planetiler.java:877)
        at com.protomaps.basemap.Basemap.run(Basemap.java:221)
        at com.protomaps.basemap.Basemap.main(Basemap.java:153)
Caused by: com.onthegomap.planetiler.util.Exceptions$FatalPlanetilerException: java.util.concurrent.ExecutionException: com.onthegomap.planetiler.util.Exceptions$FatalPlanetilerException: org.geotools.api.referencing.NoSuchAuthorityCodeException: No code "EPSG:0" from authority "European Petroleum Survey Group" found for object of type "interface org.geotools.api.referencing.crs.CoordinateReferenceSystem".
        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:105)
        at com.onthegomap.planetiler.Planetiler.lambda$addGeoPackageSource$4(Planetiler.java:409)
        at com.onthegomap.planetiler.Planetiler.lambda$ifSourceUsed$14(Planetiler.java:1003)
        at com.onthegomap.planetiler.Planetiler.run(Planetiler.java:875)
        ... 2 more
Caused by: java.util.concurrent.ExecutionException: com.onthegomap.planetiler.util.Exceptions$FatalPlanetilerException: org.geotools.api.referencing.NoSuchAuthorityCodeException: No code "EPSG:0" from authority "European Petroleum Survey Group" found for object of type "interface org.geotools.api.referencing.crs.CoordinateReferenceSystem".
        at java.base/java.util.concurrent.CompletableFuture.reportGet(Unknown Source)
        at java.base/java.util.concurrent.CompletableFuture.get(Unknown Source)
        at com.onthegomap.planetiler.stats.ProgressLoggers.await(ProgressLoggers.java:361)
        ... 10 more
Caused by: com.onthegomap.planetiler.util.Exceptions$FatalPlanetilerException: org.geotools.api.referencing.NoSuchAuthorityCodeException: No code "EPSG:0" from authority "European Petroleum Survey Group" found for object of type "interface org.geotools.api.referencing.crs.CoordinateReferenceSystem".
        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(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
Caused by: org.geotools.api.referencing.NoSuchAuthorityCodeException: No code "EPSG:0" from authority "European Petroleum Survey Group" found for object of type "interface org.geotools.api.referencing.crs.CoordinateReferenceSystem".
        at org.geotools.referencing.factory.AbstractAuthorityFactory.noSuchAuthorityCode(AbstractAuthorityFactory.java:908)
        at org.geotools.referencing.factory.epsg.DirectEpsgFactory.createCoordinateReferenceSystem(DirectEpsgFactory.java:2239)
        at org.geotools.referencing.factory.BufferedAuthorityFactory.createCoordinateReferenceSystem(BufferedAuthorityFactory.java:760)
        at org.geotools.referencing.factory.AuthorityFactoryAdapter.createCoordinateReferenceSystem(AuthorityFactoryAdapter.java:812)
        at org.geotools.referencing.factory.FallbackAuthorityFactory.createCoordinateReferenceSystem(FallbackAuthorityFactory.java:653)
        at org.geotools.referencing.factory.AuthorityFactoryAdapter.createCoordinateReferenceSystem(AuthorityFactoryAdapter.java:812)
        at org.geotools.referencing.factory.ThreadedAuthorityFactory.createCoordinateReferenceSystem(ThreadedAuthorityFactory.java:666)
        at org.geotools.referencing.DefaultAuthorityFactory.createCoordinateReferenceSystem(DefaultAuthorityFactory.java:178)
        at org.geotools.referencing.CRS.decode(CRS.java:539)
        at org.geotools.referencing.CRS.decode(CRS.java:460)
        at com.onthegomap.planetiler.reader.GeoPackageReader.readFeatures(GeoPackageReader.java:139)
        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)
        ... 4 more

It seems like there is data inside the geo-package which cannot be parsed correctly. Maybe also an issue related to planetiler directly?

@wipfli

wipfli commented Apr 29, 2025

Copy link
Copy Markdown
Collaborator

Thanks for opening this pull request. The geo package source had some recent pull requests in Planetiler. Maybe that is related?

@mxzinke

mxzinke commented May 12, 2025

Copy link
Copy Markdown
Contributor Author

@wipfli @bdon Could you please review?

@sonarqubecloud

Copy link
Copy Markdown

@wipfli

wipfli commented May 13, 2025

Copy link
Copy Markdown
Collaborator

When running on Monaco this does not seem to include the boundaries below zoom 6. Can you check please?

@wipfli

wipfli commented May 13, 2025

Copy link
Copy Markdown
Collaborator

Is there a practical advantage to switching to geopackage other than avoiding the use of a deprecated function in planetiler?

@mxzinke

mxzinke commented Aug 28, 2025

Copy link
Copy Markdown
Contributor Author

Is there a practical advantage to switching to geopackage other than avoiding the use of a deprecated function in planetiler?

As far as I know, no. Maybe there is some performance advantage because of a different data structure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants