-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
Adds zoom_adjust
to add_basemap
#228
Adds zoom_adjust
to add_basemap
#228
Conversation
looks reasonable from a quick skim |
@martinfleis Thank you for having a look! I am having one issue at the moment. With the changes, the code seems to get hung up on line 261 (256 without the changes). Lines 256 to 257 in e4de45b
If I don't pass I can't think why adding an integer value to |
If the adjustment is larger than 1 or 2 zoom levels, you need to download a lot more tiles than before. That may take some time. But I can have a look at the code if you think it is something in there. |
Ah that makes sense! It is taking a while on my machine so I think I'll spend some time trying to see if it can be sped up at all. Otherwise, from a user perspective, my implementation of |
This is useful to adjust the zoom level by ±1. Nothing else makes much sense. And for these cases, it works as expected (just tested). It also works with 2, though it takes a bit. And it is exactly the same as implemented in This exists because sometimes the data extent is just on the verge of two zoom levels and you may prefer the other one that was selected automatically. |
Perfect, that is all done then I think. My most recent commit just includes the changes we have been discussing and an additional note in the docstrings. Is there a changelog that I should add to? Thank you so much for the help and guidance here! |
We use Github release notes as a changelog so no need to add anything now. What would be nice, though, is a test. Can you add some small test, checking if the keyword works as intended? No need for anything special but we should ensure that we're loading higher or lower number of tiles than by default. |
Sure thing, I can do that 🙂 |
Sorry it has taken me a while to get back to this - I added the test a while ago but the changes seem to violate the |
Thanks. lot! |
The zoom_adjust parameter is used to adjust the automatic zoom level by integer increments. This was added in contextily=1.5.0, see geopandas/contextily#228.
The zoom_adjust parameter is used to adjust the automatic zoom level by integer increments. This was added in contextily=1.5.0, see geopandas/contextily#228.
…map (#2934) The zoom_adjust parameter is used to adjust the automatic zoom level by integer increments. This was added in contextily=1.5.0, see geopandas/contextily#228. * Document that zoom_adjust requires contextily>=1.5.0 * Raise error if zoom_adjust parameter is used with contextily<1.5.0 * Add type hint for zoom_adjust parameter * Fix typecheck by using np.array constructor instead of np.uint8 Fixes `error: Argument 1 to "unsignedinteger" has incompatible type "list[int]"; expected "SupportsInt | str | bytes | SupportsIndex" [arg-type]` * Change directive for zoom_adjust from versionadded to note * Use note and important admonitions in other parts of the docstring * Rely on sphinx-autodoc-typehints --------- Co-authored-by: Dongdong Tian <seisman.info@gmail.com> Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com>
This PR seeks to resolve this issue #188. It is currently in progress and needs to be tested but if anyone sees this and has comments on my approach so far, any feedback would be appreciated 🙂 Also, there are some interim changes that will be removed, they are just there at the moment for testing, and since I was having some conda issues so it was quicker for me to create a local venv.