question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support xyzservices TileProvider objects in hv.Tiles

See original GitHub issue

Is your feature request related to a problem? Please describe.

With the @geopandas team, we have built a new package called xyzservices to serve as a unified place for XYZ tile management. The idea behind this is that other packages will depend on that instead of having their own system and list of supported tiles hard-coded. It would be great to have holoviews on board with the idea, either by supporting xyzservices.TileProvider as an input of hv.Tiles or even refactoring tiles.py module to depend directly on xyzservices.

xyzservices itself does not have any dependencies which makes it a non-problematic dependency.

It is worth mentioning that xyzservices stores providers’ metadata in JSON under share, accessible for anyone if you have a use case for that.

I am happy to do any changes in xyzservices needed to make it as useful for you as possible if that allows centralising maintenance of providers in one place.

Describe the solution you’d like

  1. support TileProvider as an input of hv.Tiles.
import xyzservices.providers as xyz

hv.Tiles(xyz.CartoDB.Positron)

All the info Tiles require can be fetched from the TileProvider object under the hood.

  1. refactor tile management

You can remove a big chunk of the maintenance burden by refactoring tile management in tiles.py using xyzservices directly. In the first step, you can remove all metadata and simply map your existing classes to TileProvider objects. In the second, you can even dynamically support the whole xyzservices library of providers instead of the pre-defined set you have now.

Describe alternatives you’ve considered

I know that 2) may sound like a bit ambitious proposal but 1) is pretty straightforward to implement already. So I’d say that having at least the first part would be nice.

Additional context

Support of xyzservices is being implemented across the ecosystem, from geopandas’ own packages (new built-in foilum-based plotting and contextily) to leafmap (https://github.com/giswqs/leafmap/issues/91) and ipyleaflet (https://github.com/jupyter-widgets/ipyleaflet/issues/854) (+ hopefully more).

If there’s anything we would need to implement in xyzservices to make all this work, I am all ears.

It seems that @philippjfr would welcome that 😃.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:4
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jlstevenscommented, Aug 9, 2021

Thanks @martinfleis for the suggestion!

Interestingly enough, @jbednar @philippjfr and myself recently discovered xyzservices and briefly discussed this suggestion already!

It is good to have an issue opened though and from what I remember, we were thinking that xyzservices could be an optional dependency that could be used instead of replacing the existing tile source definitions. I don’t why we couldn’t support xyzservices in the constructor as in suggestion 1.

Suggestion 2 would be a bigger effort that I think we should consider (especially as we recently had issues with the wikipedia tile source no longer being public available). While that might need some discussion, I don’t think anyone will object to suggestion 1 right now.

If you are willing to make a PR on HoloViews implementing suggestion 1, that would be much appreciated! My only request would be that this is coordinated with a corresponding PR in GeoViews (as we want to maintain a consistent API between the two projects).

0reactions
xTermacommented, Aug 23, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

xyzservices: a unified source of XYZ tile providers in Python
We have built xyzservices package to support any Python library making use of XYZ tiles. ... TileProvider object when specifying tiles.
Read more >
A short look into providers objects - contextily
The provider objects being passed to add_basemap are stored as xyzservices.TileProvider objects (enhanced dictionaries with attribute access ...
Read more >
Releases — HoloViews v1.15.3
Support xyzservices.TileProvider as hv.Tiles input (#5062). Allow reversed layout/overlay binary operators for + and * to be used with custom objects (#5073).
Read more >
holoviz/holoviews: Version 1.14.7 - Zenodo
Bug fixes: Support xyzservices.TileProvider as hv.Tiles input (#5062) Allow reversed layout/overlay binary operators for + and * to be used ...
Read more >
holoviz/holoviews v1.14.7 on GitHub - NewReleases.io
Support xyzservices.TileProvider as hv.Tiles input (#5062); Allow reversed layout/overlay binary operators for + and * to be used with custom objects (#5073) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found