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 bug in auto computation of zoom levels #214

Merged
merged 1 commit into from May 30, 2023

Conversation

jelson
Copy link
Contributor

@jelson jelson commented Apr 14, 2023

For maps with large aspect ratio, contextily downloads tiles as if the map was as small as the smallest dimension. It should base the zoom level on the dimension that's a larger extent.

I discovered this bug when my server died attempting to render the following blue line on a map:
https://sondemaps.lectrobox.com/seattle/2023/4/13-17-47.64048--123.95468.jpg

This script has run fine for months, but in today's dataset the blue line coincidentally was almost perfectly horizontal. Therefore, the latitude extent of the map was very small, and because contextily uses the max of the two zoom levels, it attempted to download over a million zoomlevel 19 tiles from OSM.

@martinfleis
Copy link
Member

Yay. Thanks for the fix!

Can you also update the test that are failing because of the change?

For maps with large aspect ratio, contextily downloads tiles as if the map was
as small as the smallest dimension. It should base the zoom level on the
dimension that's a larger extent.
@jelson
Copy link
Contributor Author

jelson commented May 30, 2023

Oops - sorry about that; fixed.

Copy link
Member

@martinfleis martinfleis left a comment

Choose a reason for hiding this comment

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

Thanks!

@martinfleis martinfleis changed the title Fig bug in auto computation of zoom levels Fix bug in auto computation of zoom levels May 30, 2023
@martinfleis martinfleis merged commit 0c8c9ce into geopandas:main May 30, 2023
10 checks passed
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.

None yet

2 participants