contextily
contextily copied to clipboard
ENH: Handle minimum / maximum zoom limit for known providers
using automatic zoom in bounds2img
for a small area results in high zoom level values that exceeds the available zoom levels of the provider, and rises HTTPError:
import contextily as ctx
img, ext = ctx.bounds2img(1231934.7608171296, 5785711.490238651, 1232411.1480162584, 5785880.3953617485)
It would be great to clip the zoom level to a max_zoom
property for the known providers (18 for stamen, 19 for OSM).
I think this is related to https://github.com/darribas/contextily/issues/10. We want to have more complete list of providers, but also objects that contain more information than only the url (so eg also the attribution, max zoom level etc). Once we have that, we should indeed use that here to prevent this from happening.
See also https://github.com/darribas/contextily/pull/66 for an initial to start to get this information from leaflet-providers.js.
With #66 in, this should now be an straightforward enhancement, as the provider dicts have an optional min_zoom and max_zoom keys which can be checked.
Hey there, I was taking a look in the issues to see if there is something I could help with.
I forked this repo and clone to my machine.
I realized that you are not using python poetry
to manage the package (Is that right?).
So I installed all dependencies in requirements.txt
.
Now I am wondering how can I run the test to confirm I have all set to start contributing (It doesn't means I will work in this issue.... I see it is already done, right?).
Thanks in advance
Just to mention that I could run the tests with pytest. I will look around the issues to see where I could help. best
Hello @FelipeSBarros, thanks very much for the interest and work!
You're right, we don't use poetry
. If you want to run the tests locally, the command we use on CI is:
https://github.com/geopandas/contextily/blob/72c85a1097dfad6f03d2b0b17cd92dfd8171b0ee/.github/workflows/tests.yaml#L46
Note you'll need the dev requirements (Python 3.7, and Python 3.8 and beyond).