| Title: | Interface to the 'INSPIRE' Services of the Cadastre of Navarre |
|---|---|
| Description: | Provides access to public spatial data from the Cadastre of Navarre through its 'INSPIRE' ATOM feeds, Web Feature Service and Web Map Service endpoints provided by the Government of Navarre through the Sistema de Información Territorial de Navarra ('SITNA'). Supports complete municipal dataset downloads, bounding box feature queries and georeferenced map image downloads for addresses, buildings and cadastral parcels. |
| Authors: | Diego Hernangómez [aut, cre, cph] (ORCID: <https://orcid.org/0000-0001-8457-4658>), Francisco J. Goerlich [ctb] (ORCID: <https://orcid.org/0000-0003-1626-525X>), Gobierno de Navarra [dtc] (ROR: <https://ror.org/025qq4838>, Provider of cadastral data and INSPIRE services through SITNA) |
| Maintainer: | Diego Hernangómez <[email protected]> |
| License: | GPL-2 |
| Version: | 1.0.0.9000 |
| Built: | 2026-10-12 23:11:16 UTC |
| Source: | https://github.com/rOpenSpain/CatastRoNav |
Downloads spatial data for all addresses in a municipality using the ATOM INSPIRE service provided by the Cadastre of Navarre.
catrnav_atom_get_address( munic, cache = deprecated(), update_cache = FALSE, cache_dir = NULL, verbose = FALSE )catrnav_atom_get_address( munic, cache = deprecated(), update_cache = FALSE, cache_dir = NULL, verbose = FALSE )
munic |
A single municipality name, partial name or cadastral code.
Accepts a character string or numeric code. Use
|
cache |
|
update_cache |
Logical. Whether to refresh the cached file. Defaults to
|
cache_dir |
Path to a cache directory. If |
verbose |
Logical. Whether to display informational messages. |
Empty, missing or non-scalar values of munic produce an error before
any download is attempted. Returns NULL if no municipality matches munic.
Municipal ZIP archives are read directly without extracting their contents
to disk.
An sf object. Returns NULL if the
data cannot be
retrieved.
catrnav_atom_get_address_db_all() lists available municipal downloads.
catrnav_wfs_get_address_bbox() retrieves addresses within a bounding box
instead of downloading a complete municipal dataset.
catrnav_set_cache_dir() configures the download cache and
catrnav_clear_cache() removes cached downloads.
Query ATOM INSPIRE services:
catrnav_atom_get_address_db_all(),
catrnav_atom_get_buildings(),
catrnav_atom_get_buildings_db_all(),
catrnav_atom_get_parcels(),
catrnav_atom_get_parcels_db_all(),
catrnav_atom_search_munic()
Work with cadastral addresses:
catrnav_atom_get_address_db_all(),
catrnav_wfs_get_address_bbox(),
catrnav_wms_get_layer()
s <- catrnav_atom_get_address("Tudela") library(ggplot2) ggplot(s) + geom_sf() + labs( title = "Addresses", subtitle = "Tudela" )s <- catrnav_atom_get_address("Tudela") library(ggplot2) ggplot(s) + geom_sf() + labs( title = "Addresses", subtitle = "Tudela" )
Creates a tibble of URLs provided by the Cadastre of Navarre ATOM INSPIRE service for downloading addresses by municipality.
catrnav_atom_get_address_db_all( cache = deprecated(), update_cache = FALSE, cache_dir = NULL, verbose = FALSE )catrnav_atom_get_address_db_all( cache = deprecated(), update_cache = FALSE, cache_dir = NULL, verbose = FALSE )
cache |
|
update_cache |
Logical. Whether to refresh the cached file. Defaults to
|
cache_dir |
Path to a cache directory. If |
verbose |
Logical. Whether to display informational messages. |
A tibble with the following columns. Returns
NULL if the data cannot be retrieved.
munic: Municipality name and cadastral code.
url: ATOM URL for the corresponding municipality.
date: Reference timestamp of the data in UTC.
catrnav_atom_get_address() downloads addresses for a municipality
listed in this index.
catrnav_atom_search_munic() finds municipality names and cadastral codes.
Query ATOM INSPIRE services:
catrnav_atom_get_address(),
catrnav_atom_get_buildings(),
catrnav_atom_get_buildings_db_all(),
catrnav_atom_get_parcels(),
catrnav_atom_get_parcels_db_all(),
catrnav_atom_search_munic()
Browse ATOM municipal indexes:
catrnav_atom_get_buildings_db_all(),
catrnav_atom_get_parcels_db_all()
Work with cadastral addresses:
catrnav_atom_get_address(),
catrnav_wfs_get_address_bbox(),
catrnav_wms_get_layer()
catrnav_atom_get_address_db_all()catrnav_atom_get_address_db_all()
Downloads spatial data for all buildings in a municipality using the ATOM INSPIRE service provided by the Cadastre of Navarre.
catrnav_atom_get_buildings( munic, cache = deprecated(), update_cache = FALSE, cache_dir = NULL, verbose = FALSE )catrnav_atom_get_buildings( munic, cache = deprecated(), update_cache = FALSE, cache_dir = NULL, verbose = FALSE )
munic |
A single municipality name, partial name or cadastral code.
Accepts a character string or numeric code. Use
|
cache |
|
update_cache |
Logical. Whether to refresh the cached file. Defaults to
|
cache_dir |
Path to a cache directory. If |
verbose |
Logical. Whether to display informational messages. |
Empty, missing or non-scalar values of munic produce an error before
any download is attempted. Returns NULL if no municipality matches munic.
Municipal ZIP archives are read directly without extracting their contents
to disk.
An sf object. Returns NULL if the
data cannot be
retrieved.
catrnav_atom_get_buildings_db_all() lists available municipal downloads.
catrnav_wfs_get_buildings_bbox() retrieves buildings within a bounding box
instead of downloading a complete municipal dataset.
catrnav_set_cache_dir() configures the download cache and
catrnav_clear_cache() removes cached downloads.
Query ATOM INSPIRE services:
catrnav_atom_get_address(),
catrnav_atom_get_address_db_all(),
catrnav_atom_get_buildings_db_all(),
catrnav_atom_get_parcels(),
catrnav_atom_get_parcels_db_all(),
catrnav_atom_search_munic()
Work with cadastral buildings:
catrnav_atom_get_buildings_db_all(),
catrnav_wfs_get_buildings_bbox(),
catrnav_wms_get_layer()
s <- catrnav_atom_get_buildings("Iru<U+00F1>a") library(ggplot2) ggplot(s) + geom_sf() + labs( title = "Buildings", subtitle = "Pamplona / Iru<U+00F1>a" )s <- catrnav_atom_get_buildings("Iru<U+00F1>a") library(ggplot2) ggplot(s) + geom_sf() + labs( title = "Buildings", subtitle = "Pamplona / Iru<U+00F1>a" )
Creates a tibble of URLs provided by the Cadastre of Navarre ATOM INSPIRE service for downloading buildings by municipality.
catrnav_atom_get_buildings_db_all( cache = deprecated(), update_cache = FALSE, cache_dir = NULL, verbose = FALSE )catrnav_atom_get_buildings_db_all( cache = deprecated(), update_cache = FALSE, cache_dir = NULL, verbose = FALSE )
cache |
|
update_cache |
Logical. Whether to refresh the cached file. Defaults to
|
cache_dir |
Path to a cache directory. If |
verbose |
Logical. Whether to display informational messages. |
A tibble with the following columns. Returns
NULL if the data cannot be retrieved.
munic: Municipality name and cadastral code.
url: ATOM URL for the corresponding municipality.
date: Reference timestamp of the data in UTC.
catrnav_atom_get_buildings() downloads buildings for a municipality
listed in this index.
catrnav_atom_search_munic() finds municipality names and cadastral codes.
Query ATOM INSPIRE services:
catrnav_atom_get_address(),
catrnav_atom_get_address_db_all(),
catrnav_atom_get_buildings(),
catrnav_atom_get_parcels(),
catrnav_atom_get_parcels_db_all(),
catrnav_atom_search_munic()
Browse ATOM municipal indexes:
catrnav_atom_get_address_db_all(),
catrnav_atom_get_parcels_db_all()
Work with cadastral buildings:
catrnav_atom_get_buildings(),
catrnav_wfs_get_buildings_bbox(),
catrnav_wms_get_layer()
catrnav_atom_get_buildings_db_all()catrnav_atom_get_buildings_db_all()
Downloads spatial data for all cadastral parcels in a municipality using the ATOM INSPIRE service provided by the Cadastre of Navarre.
catrnav_atom_get_parcels( munic, cache = deprecated(), update_cache = FALSE, cache_dir = NULL, verbose = FALSE )catrnav_atom_get_parcels( munic, cache = deprecated(), update_cache = FALSE, cache_dir = NULL, verbose = FALSE )
munic |
A single municipality name, partial name or cadastral code.
Accepts a character string or numeric code. Use
|
cache |
|
update_cache |
Logical. Whether to refresh the cached file. Defaults to
|
cache_dir |
Path to a cache directory. If |
verbose |
Logical. Whether to display informational messages. |
Empty, missing or non-scalar values of munic produce an error before
any download is attempted. Returns NULL if no municipality matches munic.
Municipal ZIP archives are read directly without extracting their contents
to disk.
An sf object. Returns NULL if the
data cannot be
retrieved.
catrnav_atom_get_parcels_db_all() lists available municipal downloads.
catrnav_wfs_get_parcels_bbox() retrieves cadastral parcels within a
bounding box instead of downloading a complete municipal dataset.
catrnav_set_cache_dir() configures the download cache and
catrnav_clear_cache() removes cached downloads.
Query ATOM INSPIRE services:
catrnav_atom_get_address(),
catrnav_atom_get_address_db_all(),
catrnav_atom_get_buildings(),
catrnav_atom_get_buildings_db_all(),
catrnav_atom_get_parcels_db_all(),
catrnav_atom_search_munic()
Work with cadastral parcels:
catrnav_atom_get_parcels_db_all(),
catrnav_wfs_get_parcels_bbox(),
catrnav_wms_get_layer()
s <- catrnav_atom_get_parcels("Iru<U+00F1>a") library(ggplot2) ggplot(s) + geom_sf() + labs( title = "Cadastral Zoning", subtitle = "Pamplona / Iru<U+00F1>a" )s <- catrnav_atom_get_parcels("Iru<U+00F1>a") library(ggplot2) ggplot(s) + geom_sf() + labs( title = "Cadastral Zoning", subtitle = "Pamplona / Iru<U+00F1>a" )
Creates a tibble of URLs provided by the Cadastre of Navarre ATOM INSPIRE service for downloading cadastral parcels by municipality.
catrnav_atom_get_parcels_db_all( cache = deprecated(), update_cache = FALSE, cache_dir = NULL, verbose = FALSE )catrnav_atom_get_parcels_db_all( cache = deprecated(), update_cache = FALSE, cache_dir = NULL, verbose = FALSE )
cache |
|
update_cache |
Logical. Whether to refresh the cached file. Defaults to
|
cache_dir |
Path to a cache directory. If |
verbose |
Logical. Whether to display informational messages. |
A tibble with the following columns. Returns
NULL if the data cannot be retrieved.
munic: Municipality name and cadastral code.
url: ATOM URL for the corresponding municipality.
date: Reference timestamp of the data in UTC.
catrnav_atom_get_parcels() downloads cadastral parcels for a municipality
listed in this index.
catrnav_atom_search_munic() finds municipality names and cadastral codes.
Query ATOM INSPIRE services:
catrnav_atom_get_address(),
catrnav_atom_get_address_db_all(),
catrnav_atom_get_buildings(),
catrnav_atom_get_buildings_db_all(),
catrnav_atom_get_parcels(),
catrnav_atom_search_munic()
Browse ATOM municipal indexes:
catrnav_atom_get_address_db_all(),
catrnav_atom_get_buildings_db_all()
Work with cadastral parcels:
catrnav_atom_get_parcels(),
catrnav_wfs_get_parcels_bbox(),
catrnav_wms_get_layer()
catrnav_atom_get_parcels_db_all()catrnav_atom_get_parcels_db_all()
Searches for a municipality by name or cadastral code in the Cadastre of Navarre ATOM index.
catrnav_atom_search_munic( munic, cache = deprecated(), update_cache = FALSE, cache_dir = NULL, verbose = FALSE )catrnav_atom_search_munic( munic, cache = deprecated(), update_cache = FALSE, cache_dir = NULL, verbose = FALSE )
munic |
A single municipality name, partial name or cadastral code.
Accepts a character string or numeric code. Use
|
cache |
|
update_cache |
Logical. Whether to refresh the cached file. Defaults to
|
cache_dir |
Path to a cache directory. If |
verbose |
Logical. Whether to display informational messages. |
A tibble with the municipality name and cadastral
code. Returns NULL if no match is found or the data cannot
be retrieved.
catrnav_atom_get_address_db_all() provides the index used by this search.
catrnav_atom_get_buildings_db_all() and catrnav_atom_get_parcels_db_all()
list downloads for the other data types. Use the selected name or cadastral
code with catrnav_atom_get_address(), catrnav_atom_get_buildings() or
catrnav_atom_get_parcels() to download a complete municipal dataset.
Query ATOM INSPIRE services:
catrnav_atom_get_address(),
catrnav_atom_get_address_db_all(),
catrnav_atom_get_buildings(),
catrnav_atom_get_buildings_db_all(),
catrnav_atom_get_parcels(),
catrnav_atom_get_parcels_db_all()
catrnav_atom_search_munic("Pamplona") # Search using a numeric cadastral code. catrnav_atom_search_munic(201)catrnav_atom_search_munic("Pamplona") # Search using a numeric cadastral code. catrnav_atom_search_munic(201)
Use this function with caution. It clears cached data and configuration, specifically:
Deletes the CatastRoNav configuration directory when
config = TRUE
(tools::R_user_dir("CatastRoNav", "config")).
Deletes the cache_dir directory and its contents when
cached_data = TRUE.
Clears the CATASTRONAV_CACHE_DIR environment variable.
catrnav_clear_cache(config = FALSE, cached_data = TRUE, verbose = FALSE)catrnav_clear_cache(config = FALSE, cached_data = TRUE, verbose = FALSE)
config |
A logical value indicating whether to delete the CatastRoNav configuration directory. |
cached_data |
If |
verbose |
Logical. Whether to display informational messages. |
With config = TRUE and cached_data = TRUE, this function resets the
cache state as if you had never used CatastRoNav.
NULL, invisibly. This function is called for its
side effects.
catrnav_detect_cache_dir() identifies the active cache path before
deletion. catrnav_set_cache_dir() configures a new cache afterward.
Manage the local cache:
catrnav_set_cache_dir()
# Caution! This modifies your current state. ## Not run: my_cache <- catrnav_detect_cache_dir() example_cache <- file.path(tempdir(), "example", "cache") catrnav_set_cache_dir(example_cache, verbose = FALSE) catrnav_clear_cache(verbose = TRUE) # Restore the initial cache. catrnav_set_cache_dir(my_cache) identical(my_cache, catrnav_detect_cache_dir()) ## End(Not run)# Caution! This modifies your current state. ## Not run: my_cache <- catrnav_detect_cache_dir() example_cache <- file.path(tempdir(), "example", "cache") catrnav_set_cache_dir(example_cache, verbose = FALSE) catrnav_clear_cache(verbose = TRUE) # Restore the initial cache. catrnav_set_cache_dir(my_cache) identical(my_cache, catrnav_detect_cache_dir()) ## End(Not run)
Configures the cache directory used by CatastRoNav. Use
Sys.getenv() with "CATASTRONAV_CACHE_DIR" or
catrnav_detect_cache_dir() to inspect the current path.
catrnav_set_cache_dir( cache_dir = NULL, overwrite = FALSE, install = FALSE, verbose = TRUE ) catrnav_detect_cache_dir()catrnav_set_cache_dir( cache_dir = NULL, overwrite = FALSE, install = FALSE, verbose = TRUE ) catrnav_detect_cache_dir()
cache_dir |
Path to a cache directory. If |
overwrite |
A logical value indicating whether to overwrite an existing
|
install |
Logical. Whether to store the path locally for use in future
sessions. Defaults to |
verbose |
Logical. Whether to display informational messages. |
By default, when no cache_dir is set, CatastRoNav uses a
directory inside base::tempdir(). Files in this directory are temporary
and are removed when the R session ends. To persist a cache across R
sessions, use
catrnav_set_cache_dir(cache_dir, install = TRUE). This writes the chosen
path to a configuration file under
tools::R_user_dir() with "CatastRoNav" and "config".
catrnav_set_cache_dir() returns a character
string containing the cache path, invisibly. This function is primarily
called for its side effects.
catrnav_detect_cache_dir() returns a character
string containing the cache path used in the current session.
Source files are always cached after download. CatastRoNav implements the following caching options:
For occasional use, rely on the default tempdir()-based cache without
installing a persistent path.
Modify the cache for a single session by setting
catrnav_set_cache_dir(cache_dir = "a/path/here").
For reproducible workflows, install a persistent cache with
catrnav_set_cache_dir(cache_dir = "a/path/here", install = TRUE).
This cache is kept across R sessions.
To cache specific files elsewhere, use the cache_dir argument in the
corresponding function.
Cached files can occasionally become corrupt. In that case, download the
data again by setting update_cache = TRUE in an ATOM or WMS function.
ATOM downloads check the file size with a HEAD request and report downloads
larger than 20 MB before fetching the body. Failed ATOM updates preserve
the previous cached file. WFS queries reuse their cached response until the
cache is cleared.
ATOM indexes are stored in databases, municipal downloads in atom_ad,
atom_bu or atom_cp and WFS responses in wfs_inspire_cache.
The ATOM cache argument is deprecated and no longer changes caching.
Use a temporary cache_dir when downloads should last only for a session.
ATOM downloads and WFS queries use the catastronav_timeout and
catastronav_ssl_verify options. If unset, the CATASTRONAV_TIMEOUT and
CATASTRONAV_SSL_VERIFY environment variables are used, followed by the
catastro_timeout and catastro_ssl_verify options. The defaults are
300 seconds and enabled SSL verification. WFS queries apply these settings
only for the request and restore the previous CatastRo options.
WMS request settings are passed to mapSpain::esp_get_tiles() through
the options argument of catrnav_wms_get_layer().
If a download fails, use verbose = TRUE to inspect the request and
catrnav_detect_cache_dir() to identify the active cache path.
The configuration location has moved from
rappdirs::user_config_dir("CatastRoNav", "R") to
tools::R_user_dir() with "CatastRoNav" and "config". Existing
configuration files are migrated automatically. A migration message is shown
only once.
tools::R_user_dir() determines the persistent configuration directory.
base::tempdir() provides the default temporary cache directory.
catrnav_atom_get_address(), catrnav_atom_get_buildings() and
catrnav_atom_get_parcels() cache municipal downloads.
catrnav_wfs_get_address_bbox(), catrnav_wfs_get_buildings_bbox() and
catrnav_wfs_get_parcels_bbox() cache spatial queries.
catrnav_wms_get_layer() caches map images.
Manage the local cache:
catrnav_clear_cache()
# Caution! This modifies your current state. ## Not run: my_cache <- catrnav_detect_cache_dir() example_cache <- file.path(tempdir(), "example", "cache") catrnav_set_cache_dir(example_cache) catrnav_detect_cache_dir() # Restore the initial cache. catrnav_set_cache_dir(my_cache) identical(my_cache, catrnav_detect_cache_dir()) ## End(Not run) catrnav_detect_cache_dir()# Caution! This modifies your current state. ## Not run: my_cache <- catrnav_detect_cache_dir() example_cache <- file.path(tempdir(), "example", "cache") catrnav_set_cache_dir(example_cache) catrnav_detect_cache_dir() # Restore the initial cache. catrnav_set_cache_dir(my_cache) identical(my_cache, catrnav_detect_cache_dir()) ## End(Not run) catrnav_detect_cache_dir()
Retrieves spatial address data from the Cadastre of Navarre WFS INSPIRE
service. catrnav_wfs_get_address_bbox() retrieves features within the
supplied bounding box. See Bounding box.
catrnav_wfs_get_address_bbox(x, srs = 4326, verbose = FALSE, count = NULL)catrnav_wfs_get_address_bbox(x, srs = 4326, verbose = FALSE, count = NULL)
x |
Input defining the query area. See Bounding box. It can be: |
srs |
The CRS to use for the query. Defaults to |
verbose |
Logical. Whether to display informational messages. |
count |
A positive whole number specifying the maximum number of
features to return. If |
Responses are cached in the wfs_inspire_cache subdirectory of the
catrnav_set_cache_dir() cache. Repeated queries reuse the cached file.
Clear the cache with catrnav_clear_cache() to download fresh results.
An sf object. Returns NULL if the
data cannot be
retrieved.
The service returns a maximum of 5,000 features by default. Use count to
request a smaller result.
When x is a numeric vector, make sure that srs matches the coordinate
values. The function queries the bounding box in
EPSG:25830, ETRS89 / UTM zone 30N, then transforms the
result back to srs.
When x is an sf or sfc object, srs is ignored.
The object's bounding box is used for the query and the result is transformed
back to the input CRS. See sf::st_bbox().
catrnav_atom_get_address() downloads all addresses for a municipality.
catrnav_wms_get_layer() retrieves a georeferenced map image rather than
individual spatial features.
Query WFS INSPIRE services:
catrnav_wfs_get_buildings_bbox(),
catrnav_wfs_get_parcels_bbox()
Work with cadastral addresses:
catrnav_atom_get_address(),
catrnav_atom_get_address_db_all(),
catrnav_wms_get_layer()
downtown <- c(-1.646812, 42.814528, -1.638036, 42.820320) ad <- catrnav_wfs_get_address_bbox(downtown, srs = 4326) library(ggplot2) ggplot(ad) + geom_sf()downtown <- c(-1.646812, 42.814528, -1.638036, 42.820320) ad <- catrnav_wfs_get_address_bbox(downtown, srs = 4326) library(ggplot2) ggplot(ad) + geom_sf()
Retrieves spatial building data from the Cadastre of Navarre WFS INSPIRE
service. catrnav_wfs_get_buildings_bbox() retrieves features within the
supplied bounding box. See Bounding box.
catrnav_wfs_get_buildings_bbox(x, srs = 4326, verbose = FALSE, count = NULL)catrnav_wfs_get_buildings_bbox(x, srs = 4326, verbose = FALSE, count = NULL)
x |
Input defining the query area. See Bounding box. It can be: |
srs |
The CRS to use for the query. Defaults to |
verbose |
Logical. Whether to display informational messages. |
count |
A positive whole number specifying the maximum number of
features to return. If |
Responses are cached in the wfs_inspire_cache subdirectory of the
catrnav_set_cache_dir() cache. Repeated queries reuse the cached file.
Clear the cache with catrnav_clear_cache() to download fresh results.
An sf object. Returns NULL if the
data cannot be
retrieved.
The service returns a maximum of 5,000 features by default. Use count to
request a smaller result.
When x is a numeric vector, make sure that srs matches the coordinate
values. The function queries the bounding box in
EPSG:25830, ETRS89 / UTM zone 30N, then transforms the
result back to srs.
When x is an sf or sfc object, srs is ignored.
The object's bounding box is used for the query and the result is transformed
back to the input CRS. See sf::st_bbox().
catrnav_atom_get_buildings() downloads all buildings for a municipality.
catrnav_wms_get_layer() retrieves a georeferenced map image rather than
individual spatial features.
Query WFS INSPIRE services:
catrnav_wfs_get_address_bbox(),
catrnav_wfs_get_parcels_bbox()
Work with cadastral buildings:
catrnav_atom_get_buildings(),
catrnav_atom_get_buildings_db_all(),
catrnav_wms_get_layer()
downtown <- c(-1.646812, 42.814528, -1.638036, 42.820320) bu <- catrnav_wfs_get_buildings_bbox(downtown, srs = 4326) library(ggplot2) ggplot(bu) + geom_sf()downtown <- c(-1.646812, 42.814528, -1.638036, 42.820320) bu <- catrnav_wfs_get_buildings_bbox(downtown, srs = 4326) library(ggplot2) ggplot(bu) + geom_sf()
Retrieves spatial cadastral parcel data from the Cadastre of Navarre WFS
INSPIRE service. catrnav_wfs_get_parcels_bbox() retrieves features within
the supplied bounding box. See Bounding box.
catrnav_wfs_get_parcels_bbox(x, srs = 4326, verbose = FALSE, count = NULL)catrnav_wfs_get_parcels_bbox(x, srs = 4326, verbose = FALSE, count = NULL)
x |
Input defining the query area. See Bounding box. It can be: |
srs |
The CRS to use for the query. Defaults to |
verbose |
Logical. Whether to display informational messages. |
count |
A positive whole number specifying the maximum number of
features to return. If |
Responses are cached in the wfs_inspire_cache subdirectory of the
catrnav_set_cache_dir() cache. Repeated queries reuse the cached file.
Clear the cache with catrnav_clear_cache() to download fresh results.
An sf object. Returns NULL if the
data cannot be
retrieved.
The service returns a maximum of 5,000 features by default. Use count to
request a smaller result.
When x is a numeric vector, make sure that srs matches the coordinate
values. The function queries the bounding box in
EPSG:25830, ETRS89 / UTM zone 30N, then transforms the
result back to srs.
When x is an sf or sfc object, srs is ignored.
The object's bounding box is used for the query and the result is transformed
back to the input CRS. See sf::st_bbox().
catrnav_atom_get_parcels() downloads all cadastral parcels for a
municipality.
catrnav_wms_get_layer() retrieves a georeferenced map image rather than
individual spatial features.
Query WFS INSPIRE services:
catrnav_wfs_get_address_bbox(),
catrnav_wfs_get_buildings_bbox()
Work with cadastral parcels:
catrnav_atom_get_parcels(),
catrnav_atom_get_parcels_db_all(),
catrnav_wms_get_layer()
downtown <- c(-1.646812, 42.814528, -1.638036, 42.820320) cp <- catrnav_wfs_get_parcels_bbox(downtown, srs = 4326) library(ggplot2) ggplot(cp) + geom_sf()downtown <- c(-1.646812, 42.814528, -1.638036, 42.820320) cp <- catrnav_wfs_get_parcels_bbox(downtown, srs = 4326) library(ggplot2) ggplot(cp) + geom_sf()
Downloads georeferenced map images from the Cadastre of Navarre WMS service.
This function wraps mapSpain::esp_get_tiles().
catrnav_wms_get_layer( x, srs = 4326, what = c("building", "parcel", "address"), styles = c("default", "ELFCadastre"), update_cache = FALSE, cache_dir = NULL, verbose = FALSE, crop = FALSE, options = NULL, ... )catrnav_wms_get_layer( x, srs = 4326, what = c("building", "parcel", "address"), styles = c("default", "ELFCadastre"), update_cache = FALSE, cache_dir = NULL, verbose = FALSE, crop = FALSE, options = NULL, ... )
x |
Input defining the query area. See Bounding box. It can be: |
srs |
The CRS to use for the query. Defaults to |
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
|
cache_dir |
Path to a cache directory. If |
verbose |
Logical. Whether to display informational messages. |
crop |
Logical. If |
options |
A named list containing additional options to pass to the query. |
... |
Arguments passed on to
|
Returns NULL if the request cannot run or no image can be retrieved.
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().
The what argument selects one of the following API layers:
"parcel": CP.CadastralParcel.
"building": BU.Building.
"address": AD.Address.
The WMS service provides different styles for each layer (what argument).
Available styles include:
"parcel": "default" and "ELFCadastre".
"building": "default".
"address": "default".
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.
catrnav_wfs_get_address_bbox(), catrnav_wfs_get_buildings_bbox() and
catrnav_wfs_get_parcels_bbox() retrieve individual spatial features
within a bounding box.
catrnav_atom_get_address(), catrnav_atom_get_buildings() and
catrnav_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() and tidyterra::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()
bu <- catrnav_wms_get_layer( c(-1.646812, 42.814528, -1.638036, 42.820320), srs = 4326, what = "building" ) library(mapSpain) library(ggplot2) library(tidyterra) 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)bu <- catrnav_wms_get_layer( c(-1.646812, 42.814528, -1.638036, 42.820320), srs = 4326, what = "building" ) library(mapSpain) library(ggplot2) library(tidyterra) 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)