Helper function for esp_get_tiles() that helps to create a custom provider.
Arguments
- id
An identifier for the user. It will be 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, like
version,format,crs/srs,style, etc. 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 will not provide advice on the argument
qto be provided.Currently, on WMTS requests only services with
tilematrixset=GoogleMapsCompatibleare supported.
See also
For a list of potential providers from Spain check IDEE Directory.
Other functions for creating maps with images:
addProviderEspTiles(),
esp_get_tiles()
Examples
# \dontrun{
custom_wms <- esp_make_provider(
id = "an_id_for_caching",
q = "https://idecyl.jcyl.es/geoserver/ge/wms?",
service = "WMS",
version = "1.3.0",
layers = "geolog_cyl_litologia"
)
x <- esp_get_ccaa("Castilla y León", epsg = 3857)
mytile <- esp_get_tiles(x, type = custom_wms)
tidyterra::autoplot(mytile) +
ggplot2::geom_sf(data = x, fill = NA)
# }
