geopandas / xyzservices

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

information about new providers ¿only OSM-based or also other tile sources? #177

Open abubelinha opened 2 months ago

abubelinha commented 2 months ago

Hello. I have not clear whether this repository is only for OSM-based tiles, or it accepts also other tile-services.

Particularly, I arrived xyzservices from the link provided on contextily documentation, since I wanted to use the tiles of Spanish national basemap, as linked in Spanish Spatial Data Infrastructure tile services page. Examples:

Mapa Base de España: https://tms-ign-base.idee.es/1.0.0/IGNBaseTodo/{z}/{x}/{-y}.jpeg https://tms-ign-base.idee.es/1.0.0/IGNBaseOrto/{z}/{x}/{-y}.png

Cartografía Ráster de España del IGN: https://tms-mapa-raster.ign.es/1.0.0/mapa-raster/{z}/{x}/{-y}.jpeg

Ortoimágenes MA de España (Sentinel2 y PNOA MA): https://tms-pnoa-ma.idee.es/1.0.0/pnoa-ma/{z}/{x}/{-y}.jpeg

I first tried to manually add these sources in contextily this way:

import contextily as cx
# gdf is a simple geodataframe of a 10 x 10 Km square polygon inside Spain
ax = gdf.plot(figsize=(10, 10), alpha=0.05, edgecolor="k")
# this works well for my area:
tile_source = cx.providers.OpenStreetMap.Mapnik  
tile_attribution = 'OSM contributors' 
# but this fails:
tile_source='https://tms-pnoa-ma.idee.es/1.0.0/pnoa-ma/{z}/{x}/-{y}.jpeg'  
tile_attribution = 'idee.es pnoa-ma'
cx.add_basemap(ax=ax, crs='epsg:4326', source=tile_source, attribution=tile_attribution)

I tested them for a small Spanish area but I am getting a blank map. I guess I am wrongly implementing the minus symbol in y coordinate (if I use {-y} as in the provided links, I get a KeyError: '-y' Python error). Could somebody help me on this?

Also, being this a Spanish provider perhaps @darribas knows whether these tiles licenses' are compatible with contextily/xyzservices or not? I was not sure if I should ask in contextily or in xyzservices. I decided to ask here because if these services are suitable for xyzservices repository it could make sense to add them as @martinfleis explained in #153

Thanks in advance @abubelinha

martinfleis commented 2 months ago

Hey, any tiles are welcome, no need to be OSM-derived. We have plenty that are of a different origin already. Feel free to open a PR!

Regarding the issue, please report it to contextily. I am not sure we support negative there. Probably not.

abubelinha commented 2 months ago

OK thanks. I have no idea about the negative-y implications, I hope it is something easy to adapt to contextily

I asked in contextily: if I get it to work, I'll be back here with json info about the new providers (unfortunately I am not a git user and making PRs is beyond my skills).

abubelinha commented 2 months ago

Also related to not OSM-based services, I asked about esri arcgis wmts tile servers in these issues.