geopandas / xyzservices

Source of XYZ tiles providers
https://xyzservices.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
169 stars 32 forks source link

ENH: add `flatten` method on `Bunch` #67

Closed martinfleis closed 3 years ago

martinfleis commented 3 years ago

It would be great if xyzservices can add a function that returns a non-nested dictionary of all tiles, similar to the get_xyz_dict function I implemented in leafmap. My implementation is probably not optimal. https://github.com/giswqs/leafmap/blob/master/leafmap/basemaps.py#L206

From @giswqs https://twitter.com/giswqs/status/1423265380236201984


I guess that a method Bunch.flatten() returning a flat dict would be a good one. Thanks for the suggestion!

martinfleis commented 3 years ago

@giswqs regarding keywords filtering providers, I'd wait for #42. Then the API mirroring your free_only=True keyword would be xyz.filter(requires_token=False).flatten().

giswqs commented 3 years ago

Awesome! This will make it much easier to pass the list of tiles to the leafmap basemap GUI.