-
-
Notifications
You must be signed in to change notification settings - Fork 85
ENH: map tile overlays #114
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
Conversation
Tilesets identified in providers that are known to be overlay tiles (with an embedded alpha channel) or that have defined opacity less than 1.0 are drawn over other data (with a default zorder of 9, unless this is overridden manually).
Any idea if/when a release is going to get this feature? |
Thanks for this @jpn-- !!! I haven't had a second to review it myself, but does not look to onerous. Right now, our efforts are centered on settling the providers api, which we already have decided what to do (#90) and with that I'd be keen to push |
…iles Updates to test_ctx.py for compatibility with recent changes to ctx
I noticed development here recently kicked into "active", and that some of the recent changes wouldn't merge cleanly with the changes I made to the tests for the overlay feature, so I went ahead and tweaked my changes so that they do merge cleanly, hopefully this makes it easier to review this now. Thanks to you all for making this awesome tool! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And thank you for this contribution!
Generally looks good to me, added some minor comments.
We probably want to add some examples for this in the notebook about add_basemap
, once that exists (so don't worry about that for now)
Glad to contribute! When the rest of a notebook about |
…iles * commit '3c26d5a16a094e8d5ae05f8e5a41f05278816daf': DOC: update for latest pydata-sphinx-theme (fix sidebar + use CSS variables) (geopandas#168) RLS: v1.0.1 Fix resetting of extent with local files (geopandas#155) (geopandas#156) Add random user ID for Nominatim and allow arbitrary geocoder (geopandas#164) Close and reopen memfile dataset before WarpedVRT (geopandas#165) Fix use of rasterio MemoryFile (geopandas#163) DOC: Use Cape Town consistently in description and variable names (geopandas#154) Add matplotlib Framework classifier (geopandas#152) Require Python 3.6 as minimum version (geopandas#150) Add earthengine to docker for binder Example interfacing GEE with contextily (geopandas#147) DOC: add notebook about working with local files (geopandas#139) # Conflicts: # tests/test_ctx.py
I needed to use this so I updated it for myself. I also added an example in the add_basemap notebook. |
This looks fantastic! @jorisvandenbossche do the changes look good to you? If so, we can merge, and I think it'd be good to push it as 1.1, it's a really cool little feature! (I'm happy to take care of the release) |
This feature is really cool and nice to have. I stumbled on a need for this, and @jpn-- patch got me fixed up right away. |
Hello everyone, sorry for my slow moving on this (my bandwidth is what it is...). Just to say I'm planning on having a look at this PR in the coming days and if it's all good, happy to merge and have this on contextily. Once merged, I think this is good enough to cut a 1.1 release so folks can enjoy it more widely. Hopefully more on this soon... |
Hi @jpn-- one quick thing, if I checkout your PR and try to open the intro notebook, I get this error: [W 03:29:58.793 NotebookApp] Unreadable Notebook: /home/jovyan/work/notebooks/intro_guide.ipynb NotJSONError('Notebook does not appear to be JSON: \'{\\n "cells": [\\n {\\n "cell_type": "m...') Can you have a look to see if there's any conflict of some sort? Thanks! I'm looking at the other files too :) |
Sorry @darribas, my experiment with commit hooks was too clever by half, or not clever enough? In any case, the notebook should be all better now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fantastic!!! I've had a more in detail look to get my hear around and this is so simple yet so powerful! If you consider this good to go, I'm very happy to merge it, just OK this comment
I'm not clear if "you" is me or @jorisvandenbossche, I'm happy to see this merged either way. |
Just wanted to make sure there wasn't any extra add to the PR. THANK you very much for the contribution this is fantastic! Hopefully I can cut a quick release in the coming days so it's available on pip/conda to everyone! |
This addresses #89. Tile sets identified in providers that are known to be overlay tiles, with an embedded alpha channel, using the same named rules from leaflet) or that have defined opacity less than 1.0 are drawn over other data (with a default zorder of 9, unless this is overridden manually). This will typically put the overlay tiles on top of other baseman tiles (almost certainly always good) and also on top of other data being plotted by the user. This second outcome is sometimes good, sometimes not, and I'm not sure if this default setting is reasonable. But, even setting zorder to 1 will put the labels on top of other user content unless the user intentionally put a zorder value on what they draw. I am certainly open to implementing other options here if anyone cares deeply (or shallowly).
One side effect of this change is that all map tiles are processed with the alpha channel intact. This will add a bit to memory requirements, but likely not enough for anyone to notice (other than the tests, which I've edited to accommodate the alpha channels across the board.)