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_getTiles() that helps to create a custom provider.

Usage

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

Arguments

id

An identifier for the user. Would be used also 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 parameters to the query, like version, format, crs/srs, style, ... depending on the capabilities of the service.

Details

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

Note that:

  • mapSpain would not provide advice on the parameter q to be provided.

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

Value

A named list with two elements id and q.

See Also

esp_getTiles().

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

Other imagery utilities: addProviderEspTiles(), esp_getTiles(), esp_tiles_providers

Examples

## Not run: 
# This script downloads tiles to your local machine
# Run only if you are online

custom_wms <- esp_make_provider(
  id = "an_id_for_caching",
  q = "https://idecyl.jcyl.es/geoserver/ge/wms?",
  service = "WMS",
  layers = "geolog_cyl_litologia"
)

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

mytile <- esp_getTiles(x, type = custom_wms)

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

## End(Not run)

mapSpain documentation built on July 26, 2023, 5:29 p.m.