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

Fix high zoom 512/256 tile size #357

Merged
merged 2 commits into from
Nov 20, 2018

Conversation

zerebubuth
Copy link
Member

The code was passing the coordinate max zoom to calculate_sizes_by_zoom. For example, with 8x8 metatiles and a max nominal zoom of 16, it would pass 13. This meant that 256px tiles were being generated for 3 more zoom levels than we really needed.

Added comments saying it's coordinate zoom and fixed the tests to pass in the coordinate zoom, with a one-line update to the method itself. This should mean we only get 256px tiles at max zoom, and not before.

We generate "overzoomed" tiles at the maximum zoom - i.e: if we normally generate 512px tiles, then at nominal zoom 16 we also generate 256px tiles. However, we were previously comparing nominal zoom with metatile coordinate zoom, and so were generating the 256px tiles for nominal zooms 13-16 (meta coord zooms 10-13). This fixes that issue, adds a test to catch regressions, and adds documentation explaining that the `max_zoom` parameter is coordinate zoom, not nominal zoom.
@zerebubuth zerebubuth merged commit 41645d5 into master Nov 20, 2018
@zerebubuth zerebubuth deleted the zerebubuth/fix-max-zoom-tile-sizes branch November 20, 2018 14:07
Copy link
Member

@rmarianski rmarianski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

3 participants