Downloads georeferenced map images from the Cadastre of Navarre WMS service.
This function wraps mapSpain::esp_get_tiles().
Arguments
- x
Input defining the query area. See Bounding box. It can be:
- srs
The CRS to use for the query. Defaults to
4326. See Bounding box.- what
WMS layer to download. See Layers and styles.
- styles
Style to apply to the selected WMS layer. See Layers and styles.
- update_cache
Logical. Whether to refresh the cached file. Defaults to
FALSE.- cache_dir
Path to a cache directory. If
NULL, uses the configured cache or a directory insidebase::tempdir(). Seecatrnav_set_cache_dir().- verbose
Logical. Whether to display informational messages.
- crop
Logical. If
TRUE, crop results to the specifiedxextent. Ifxis ansfobject with onePOINT,cropis set toFALSE. Seeterra::crop().- options
A named list containing additional options to pass to the query.
- ...
Arguments passed on to
mapSpain::esp_get_tilesresCharacter string or number. Only valid for WMS providers. Resolution (in pixels) of the final tile.
bbox_expandNumber. Expansion percentage of the bounding box of
x.transparentLogical. Whether to use a transparent background, if supported.
maskLogical.
TRUEto mask the result tox. Seeterra::mask().
Value
A SpatRaster with three RGB or four RGBA layers.
Returns NULL if the request cannot run or no image can be
retrieved. See terra::RGB().
Layers and styles
Bounding box
When x is a numeric vector, make sure that srs matches the coordinate
values. When x is an sf object, the srs value is
ignored.
The query uses EPSG:3857 (Web Mercator), then
transforms the tile back to the SRS of x. If the tile appears distorted,
provide a spatial object as x or set srs to the SRS of the requested
tile. See Examples.
See also
catrnav_wfs_get_address_bbox(),catrnav_wfs_get_buildings_bbox()andcatrnav_wfs_get_parcels_bbox()retrieve individual spatial features within a bounding box.catrnav_atom_get_address(),catrnav_atom_get_buildings()andcatrnav_atom_get_parcels()download complete municipal vector datasets.catrnav_set_cache_dir()configures where downloaded images are cached.catrnav_clear_cache()removes cached images.mapSpain::esp_get_tiles()downloads map tiles.terra::RGB()identifies RGB channels.terra::plotRGB()andtidyterra::geom_spatraster_rgb()plot RGB rasters.
Work with cadastral addresses:
catrnav_atom_get_address(),
catrnav_atom_get_address_db_all(),
catrnav_wfs_get_address_bbox()
Work with cadastral buildings:
catrnav_atom_get_buildings(),
catrnav_atom_get_buildings_db_all(),
catrnav_wfs_get_buildings_bbox()
Work with cadastral parcels:
catrnav_atom_get_parcels(),
catrnav_atom_get_parcels_db_all(),
catrnav_wfs_get_parcels_bbox()
Examples
# \donttest{
bu <- catrnav_wms_get_layer(
c(-1.646812, 42.814528, -1.638036, 42.820320),
srs = 4326,
what = "building"
)
library(mapSpain)
library(ggplot2)
library(tidyterra)
#>
#> Attaching package: ‘tidyterra’
#> The following object is masked from ‘package:stats’:
#>
#> filter
ggplot() +
geom_spatraster_rgb(data = bu)
# Download cadastral parcels.
parc <- catrnav_wms_get_layer(
c(-1.646812, 42.814528, -1.638036, 42.820320),
srs = 4326,
what = "parcel"
)
ggplot() +
geom_spatraster_rgb(data = parc)
# }
