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

ENH: Handle minimum / maximum zoom limit for known providers #67

Open
sanzoghenzo opened this issue Apr 29, 2019 · 5 comments
Open

ENH: Handle minimum / maximum zoom limit for known providers #67

sanzoghenzo opened this issue Apr 29, 2019 · 5 comments

Comments

@sanzoghenzo
Copy link

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).

@jorisvandenbossche
Copy link
Member

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.

@jorisvandenbossche jorisvandenbossche changed the title Handle maximum zoom limit for known providers in _calculate_zoom ENH: Handle minimum / maximum zoom limit for known providers Aug 1, 2019
@jorisvandenbossche
Copy link
Member

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.

@FelipeSBarros
Copy link

FelipeSBarros commented Oct 20, 2021

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

@FelipeSBarros
Copy link

Just to mention that I could run the tests with pytest.
I will look around the issues to see where I could help.
best

@darribas
Copy link
Collaborator

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:

run: pytest -v . --cov=contextily --cov-append --cov-report term-missing --cov-report xml

Note you'll need the dev requirements (Python 3.7, and Python 3.8 and beyond).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants