-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
writer: Leaf directories: Find best base zoom #23
Conversation
... to avoid extra indirection for as many tiles as we can
Cc protomaps/go-pmtiles#6 where this came up |
Yeah, let me test this some more. For background, the code as-is is designed for a "full pyramid", even if is not the whole world: what "full" means is that if tile 8, 6, 3 exists in the tileset, then 7, 3, 2 also must exist, and 6, 2, 1 ... etc. a non-full pyramid means that the map has nothing to show when zooming out past a certain level, or must lock the UI to a minimum zoom, both which aren't a great user experience. Regardless, the PMTiles reference implementations should do something smarter for full + deep pyramids (zoom levels 20+, for example) |
|
Yeah, that was what I meant - the current very primitive implementation of leafs at 7 is not optimized even for non-global full pyramids. Ideally this can have a reasonable implementation in python with unit tests that I can then port over to the Go and C++ implementations as those don't support writing leaves yet. Can you give an example of the distinction between overlays and basemaps? My impression is that tilesets will always benefit from including generalizations at lower zooms, at the expense of more work to write + larger archive size. |
Sure:
|
Okay, those are good examples of cases where we don't want a "full" pyramid. When I get to revisiting this I'll make sure there's no optimizations made assuming that the tileset is complete for lower zooms. |
Sorry for the delay - merging this now! The JavaScript client needs to be updated to handle leaf levels >7, which I'm hoping to work on this week. |
The JavaScript client should handle leaf levels >7, and the python writer has been rewritten to correct edge cases and work more efficiently - please give it a try if you can: (on master, not on PyPI yet) https://github.com/protomaps/PMTiles/blob/master/python/pmtiles/writer.py#L14 |
... to avoid extra indirection for as many tiles as we can
Previously, we hardcoded a "base_zoom = 7", which is only only optimal for a whole world map.
instead "7" is replaced with min zoom that fits all tiles.
I only tested on one example (Bugianen, 152742 tiles) and got the expected base zoom of 14.
So, this needs more testing.