Skip to content

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

Open
@abubelinha

Description

@abubelinha

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions