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] Configure zoom levels per layer #573

Open
boldtrn opened this issue May 1, 2023 · 3 comments
Open

[FEATURE] Configure zoom levels per layer #573

boldtrn opened this issue May 1, 2023 · 3 comments

Comments

@boldtrn
Copy link
Contributor

boldtrn commented May 1, 2023

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

I would like to change min zooms of a layer. So for example I would like to don't have any buildings on z13.

Describe the solution you'd like

We discussed this in slack here.

Two solutions where proposed:

  1. FeatureRenderer takes PlanetilerConfig in it's constructor, then handles each feature here: https://github.com/onthegomap/planetiler/blob/a59f291d944e37d4af8da2955a9f19ef4007[…]main/java/com/onthegomap/planetiler/render/FeatureRenderer.java so we'd want to encode the mapping from layer to minzoom/maxzoom there and use it in renderPoint/renderLineOrPolygon
  2. FeatureCollector (what handles the setMinZoom/setMaxZoom calls) defaults each feature to the overall minzoom/maxzoom from config (source) then caps the minzoom/maxzoom from the set calls (source), so we'd want to change those calls to to call be something like config.minzoomForLayer(layer) instead of config.minzoom()
@msbarry
Copy link
Contributor

msbarry commented May 1, 2023

I think option 2 would be preferable here to make FeatureCollector the central place that controls layers/attribute assignment. We just need to decide what we want the command-line syntax to look like to set the maxzoom (and minzoom) for individual layers would look like? Would something like --layer-minzooms=building:14,mountain_peak:13 work?

I could see future similar arguments like:

  • --only-layers=building,mountain_peak and --exclude-layers=building,mountain_peak to include/exclude certain layers (currently openmaptiles profile handles these explicitly, but this would make those work across any profile)
  • --exclude-attrs=building.height,building.name,mountain_peak.ele_m
  • --only-attrs=building.height,building.name,mountain_peak.ele_m
  • --attr-minzooms=mountain_peak.ele_m:10,building.height:14

@boldtrn
Copy link
Contributor Author

boldtrn commented May 1, 2023

This would be really great and I like the syntax 👍

@forgotPassword
Copy link

@msbarry Would it be possible to configure everything per zoom level? For example I want to set different bounds per zoom level. I am mainly interested in showing a single city, but I want to allow the user to zoom-out a bit so he can see where he is, this "forces" me to include larger bounds (and resulting in larger file).

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

No branches or pull requests

3 participants