Skip to content

fix: switch from addNaturalEarthSource to addGeoPackageSource #474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mxzinke
Copy link
Contributor

@mxzinke mxzinke commented Apr 28, 2025

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
Copy link
Contributor Author

mxzinke commented Apr 28, 2025

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
Copy link
Collaborator

wipfli commented Apr 29, 2025

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

@mxzinke
Copy link
Contributor Author

mxzinke commented May 12, 2025

@wipfli @bdon Could you please review?

@wipfli
Copy link
Collaborator

wipfli commented May 13, 2025

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

@wipfli
Copy link
Collaborator

wipfli commented May 13, 2025

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

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