Skip to content
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

[FEATURE] Speed-up Planetiler by skipping OSM reads when generating only layers which do not need OSM data #823

Closed
phanecak-maptiler opened this issue Feb 28, 2024 · 2 comments · Fixed by #822

Comments

@phanecak-maptiler
Copy link
Contributor

phanecak-maptiler commented Feb 28, 2024

Is your feature request related to a problem? Please describe.

When I'm working on just one layer, say water (using custom Profile and the layer using only Natural Earth), I'm running Planetiler like this:

java ... --only-layers=water ...

And the problem is, that for this particular layer only data from water_polygons, the rest is skipped, except OSM, which gets read anyway.

Describe the solution you'd like

If I'm generating only layers which do not work with OSM data, reading of OSM data should be skipped.

Describe alternatives you've considered

Using some small dummy OSM source data via --osm_path=...., say "monaco.osb.pbf" even if generating whole "planet".

Additional context

Custom Profile employed, which has water layer using only Natural Earth.

@msbarry
Copy link
Contributor

msbarry commented Feb 29, 2024

I think this is already happening, when you filter layers the planetiler-openmaptiles profile decides which sources are needed based on the interfaces that the remaining layers implement:

public class Water implements
  OpenMapTilesSchema.Water,
  Tables.OsmWaterPolygon.Handler,
  OpenMapTilesProfile.NaturalEarthProcessor,
  OpenMapTilesProfile.OsmWaterPolygonProcessor,
  ForwardingProfile.FeaturePostProcessor {

If you remove Tables.OsmWaterPolygon.Handler then it should skip reading osm when you do --only-layers=wayer?

@msbarry
Copy link
Contributor

msbarry commented Feb 29, 2024

Oh sorry actually you're right, it does that for the other sources, but not osm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants