| catr_wms_get_layer | R Documentation |
Get geotagged images from the Spanish Cadastre. This function is a
wrapper of mapSpain::esp_get_tiles().
catr_wms_get_layer(
x,
srs = NULL,
what = c("building", "buildingpart", "parcel", "zoning", "address", "admboundary",
"admunit"),
styles = "default",
update_cache = FALSE,
cache_dir = NULL,
verbose = FALSE,
crop = FALSE,
options = NULL,
...
)
x |
See Bounding box. It may be:
|
srs |
SRS/CRS to use on the query. To see allowed values, use
catr_srs_values, specifically the |
what, styles |
Layer and style of the WMS layer to be downloaded. See Layers and styles. |
update_cache |
logical, should the cached file be refreshed? Defaults to
|
cache_dir |
Path to a cache directory. On |
verbose |
Logical. If |
crop |
logical. If |
options |
A named list containing additional options to pass to the query. |
... |
Arguments passed on to
|
A SpatRaster is returned, with 3 (RGB) or 4 (RGBA) layers,
see terra::RGB().
When x is a numeric vector, make sure that the srs matches the
coordinate values. When x is a sf object, the value
srs is ignored.
The query is performed using EPSG:3857 (Web Mercator)
and the tile is projected back to the SRS of x. In case that the tile
looks deformed, try either providing x or specify the SRS of the requested
tile via the srs argument, which should match the SRS of
x. See Examples.
The argument what defines the layer to be extracted. The equivalence with
the
API Docs
reference is:
"parcel": CP.CadastralParcel
"zoning": CP.CadastralZoning
"building": BU.Building
"buildingpart": BU.BuildingPart
"address": AD.Address
"admboundary": AU.AdministrativeBoundary
"admunit": AU.AdministrativeUnit
The WMS service provides different styles on each layer (what argument).
Some of the styles available are:
"parcel": styles : "BoundariesOnly", "ReferencePointOnly",
"ELFCadastre".
"zoning": styles : "BoundariesOnly", "ELFCadastre".
"building", "buildingpart": "ELFCadastre"
"address": "Number.ELFCadastre"
"admboundary", "admunit": "ELFCadastre"
Check the API Docs for more information.
mapSpain::esp_get_tiles() and terra::RGB(). For plotting see
terra::plotRGB() and tidyterra::geom_spatraster_rgb().
INSPIRE API functions:
catr_atom_get_address(),
catr_atom_get_address_db_all(),
catr_atom_get_buildings(),
catr_atom_get_buildings_db_all(),
catr_atom_get_parcels(),
catr_atom_get_parcels_db_all(),
catr_wfs_get_address_bbox(),
catr_wfs_get_buildings_bbox(),
catr_wfs_get_parcels_bbox(),
inspire_wfs_get()
Other spatial:
catr_atom_get_address(),
catr_atom_get_buildings(),
catr_atom_get_parcels(),
catr_wfs_get_address_bbox(),
catr_wfs_get_buildings_bbox(),
catr_wfs_get_parcels_bbox()
# With a bbox
pict <- catr_wms_get_layer(
c(222500, 4019500, 223700, 4020700),
srs = 25830,
what = "parcel"
)
library(mapSpain)
library(ggplot2)
library(tidyterra)
ggplot() +
geom_spatraster_rgb(data = pict)
# With a spatial object
parcels <- catr_wfs_get_parcels_neigh_parcel("3662303TF3136B", srs = 25830)
# Use styles
parcels_img <- catr_wms_get_layer(parcels,
what = "buildingpart",
srs = 25830, # As parcels object
bbox_expand = 0.3,
styles = "ELFCadastre"
)
ggplot() +
geom_sf(data = parcels, fill = "blue", alpha = 0.5) +
geom_spatraster_rgb(data = parcels_img)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.