Open mattijn opened 6 months ago
Nice to see altair-tiles in action and great idea for a feature! I'd also like to make this happen but not yet sure how. Replacing the base url part with a parameter requires regex as shown in your example as a provider does not have a base_url
parameter or similar, just a full url
which includes all relevant parameters. I'd assume that these are similarly structured but it's probably the safest to continue to use xyzservices.Providers.build_url
to create the actual URL, right?
Maybe we could pass in multiple providers and then altair_tiles builds this by itself? That might not require any regex as we can use build_url
internally to pregenerate all URLs and then use a dropdown to select the proper ones.
I'll think some more about this and will play around with it. Ideas are welcome! :)
I'm trying to explore some more use-cases!
Ah I see, the build_url
is delegated to the xyzservices build_url
, which is more advanced than just formatting z
, x
, y
. Not sure how to generalize this then. At least I found a way for now..
Feature request! I'm trying to use
altair_tiles
within a coastal project for monitoring. I've multiple satellite images of this location that are available as wmts-links. Currently it is easy to add a single tile-layer, but could this become more dynamic so multiple layers of a provider can be selected as parameter?An example. The following works
But now I like to add more options for the tile provider, like something as such:
This is just adding the options, but to make this actual work, something needs to modified to utilize this
base_url_options
param. I was inspecting the created vega-lite specification and noticed the following, hardcoded in a transform calculateMaybe we can update
altair_tiles
, so this URL is referenced by a parameter, which can be easily modified to listen to thebase_url_options
param. Something as such:https://github.com/altair-viz/altair_tiles/assets/5186265/b9c05abe-8ca0-41d1-87b8-b4c1fd28ba43
I think this feature require a change in the code around here: https://github.com/altair-viz/altair_tiles/blob/main/altair_tiles/__init__.py#L262
(btw, I'm not sure if these wmts-URLs are accessible outside the Netherlands.)