xyzservices
xyzservices copied to clipboard
Conquer the world
Once xyzservices
is relased and has a stable API, it would be great to see it adopted as the one-stop shop for XYZ services in Python. Opening this ticket to brainstorm on which for which packages we would love to adopt the library, and what we could do to make adoption easy and smooth.
So far:
- [x]
contextily
: version 1.2 will swap its currentproviders
submodule forxyzservices
under the hood, adding deprecation notices. This means thecontextily
user will be able to pass a tile provider to, say,add_basemap
and it'll magically use that without any attribution, URL, etc. being passed. -> https://github.com/geopandas/contextily/pull/183 - [x]
geopandas explore
: first release will rely directly onxyzservices
for tile providers. The user will be able to pass aTileProvider
object to specify the basemap to be used
It'd be great to also get on board:
- [x]
folium
: the user would be able to pass aTileProvider
object and avoid specifying URL, attribution, etc. arguments -> https://github.com/python-visualization/folium/pull/1498; folium will depend on xyzservices from 0.16 -> https://github.com/python-visualization/folium/pull/1827 - [x]
ipyleaflet
: the user would be able to pass aTileProvider
object and avoid specifying URL, attribution, etc. arguments. Conversations have started over atcontextily#153
. -> https://github.com/jupyter-widgets/ipyleaflet/issues/854 - [x]
leafmap
: the user would be able to pass aTileProvider
object and avoid specifying URL, attribution, etc. arguments -> https://github.com/giswqs/leafmap/issues/91 - [x]
holoviews
-> https://github.com/holoviz/holoviews/issues/5057 - [x]
geoviews
-> https://github.com/holoviz/geoviews/issues/517 - [x]
here-map-widget-for-jupyter
-> https://github.com/heremaps/here-map-widget-for-jupyter/pull/27 - [x]
bokeh
has similar machinery as Holoviews. Could support TileProvider as input or depend on us directly when specifying metadata. (https://docs.bokeh.org/en/latest/docs/reference/tile_providers.html#bokeh-tile-providers) -> https://github.com/bokeh/bokeh/issues/11500 and https://github.com/bokeh/bokeh/pull/11512 - [ ]
plotly
is another one but I am not sure about their implementation
a lot of edits by @martinfleis
Update, as of #28 folium
users and those of any other library that takes URLs can use xyzservices
manually. For example:
import folium
import xyzservices.providers as xyz
tiles = xyz.CartoDB.Positron
folium.Map(
location=[53.4108, -2.9358],
tiles=tiles.build_url(),
attr=tiles.attribution,
)
Holoviews also support tiles and has them hard-coded in their source code https://github.com/holoviz/holoviews/blob/master/holoviews/element/tiles.py
xyzservices
looks great. I look forward to adopting it for geemap and leafmap once it has a stable release.
BTW, any chance for supporting WMS services as well?
A lot of WMS services can be found at https://apps.nationalmap.gov/services
xyzservices looks great. I look forward to adopting it for geemap and leafmap once it has a stable release.
@giswqs Thanks! Is there anything you'd like to see to support it in your packages that is not in yet? For the use in contextily
we already consider the current release stable.
BTW, any chance for supporting WMS services as well?
What do you need for that? It is just an URL, name, and attribution as it is with XYZ, right? I think it makes sense to add it to the mix, together with some attribute storing the service type. The same actually applies to vector tiles (where it may be a bit more complicated due to styles but doable as well).
@martinfleis Let me do some testing and will provide feedback here later. Thanks.
Adding cartopy
to the mix. They may be interested in supporting TileProvider
object as well.
https://github.com/SciTools/cartopy/blob/master/lib/cartopy/io/img_tiles.py
https://github.com/heremaps/here-map-widget-for-jupyter now also uses providers from xyzservices
as basemaps :)

Note: I will do the release soon.
I think that plotly currently does not support custom XYZ tiles in any form, only mapbox styles, so there's no place for us at the moment.
Greppo now supports xyzservices for its base_layer 🚀
@krish-adi nice! Thanks for letting us know!