esp_make_provider: Create a custom tile provider

View source: R/esp-make-provider.R

esp_make_providerR Documentation

Create a custom tile provider

Description

Helper function for esp_get_tiles() that helps to create a custom provider.

Usage

esp_make_provider(id, q, service, layers, ...)

Arguments

id

An identifier for the user. Used for identifying cached tiles.

q

The base URL of the service.

service

The type of tile service, either "WMS" or "WMTS".

layers

The name of the layer to retrieve.

...

Additional arguments to the query, such as version, format, crs/srs and style, depending on the capabilities of the service.

Details

This function is meant to work with services provided under the OGC Standard.

Note that:

  • mapSpain does not provide advice on the value of q.

  • Currently, for WMTS requests only services with tilematrixset=GoogleMapsCompatible are supported.

Value

A named list with two elements id and q.

For a list of potential providers from Spain, check the IDEE Directory.

See Also

Static map tiles and imagery: addProviderEspTiles(), esp_get_attributions(), esp_get_tiles()

Examples


## Not run: 
custom_wmts <- esp_make_provider(
  id = "example",
  q = "https://www.ign.es/wmts/ign-base?",
  service = "WMTS",
  layer = "IGNBaseTodo"
)

x <- esp_get_ccaa("Castilla y León", epsg = 3857)

mytile <- esp_get_tiles(x, type = custom_wmts)

tidyterra::autoplot(mytile) +
  ggplot2::geom_sf(data = x, fill = NA)

## End(Not run)


mapSpain documentation built on Aug. 31, 2026, 5:07 p.m.