Open kannes opened 4 years ago
@kannes thanks for the report!
You are linking to the "old" provider definitions. The ones in https://github.com/darribas/contextily/blob/master/contextily/_providers.py should eventually replace that. However, also there, we are using a hardcoded subdomain:
(the {s}
gets later filled with "a" if not provided by the user)
Ideally it would be changed there, but if needed, we can also patch the url in contextily (the linked _providers.py
file is auto-generated based on https://github.com/leaflet-extras/leaflet-providers source, but can add some patches to the conversion code).
It seems that leaflet "divides" over the different domains using a calculation based on the coordinates for a given tile:
Ah, I was just following the code from the example notebook :)
It seems that leaflet "divides" over the different domains using a calculation based on the coordinates for a given tile:
That sounds wild!
The docs https://leafletjs.com/reference-1.6.0.html#tilelayer imply that {s} is replaced by "a", "b", or "c" unless the user sets different options. That's how I always understood it too, with those three subdomains being available. Sounds like it would be safe to simply randomly use a, b or c if there is a {s}
in a URL.
https://github.com/darribas/contextily/blob/master/contextily/tile_providers.py#L19-L22 specifies
OSM_A
toOSM_C
witha
tob
as (sub-)subdomains. Please always just use thetile.openstreetmap.org
as any request to it will automatically be shared between the sub-hosts.