geopandas/xyzservices

Conquer the world

Opened this issue ยท 10 comments

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:

  • contextily: version 1.2 will swap its current providers submodule for xyzservices under the hood, adding deprecation notices. This means the contextily 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. -> geopandas/contextily#183
  • geopandas explore: first release will rely directly on xyzservices for tile providers. The user will be able to pass a TileProvider object to specify the basemap to be used

It'd be great to also get on board:

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

sackh commented

https://github.com/heremaps/here-map-widget-for-jupyter now also uses providers from xyzservices as basemaps :)

Screenshot 2021-08-10 at 2 43 06 PM

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!