| 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. 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>) |
| Maintainer: | Diego Hernangómez <[email protected]> |
| License: | GPL-2 |
| Version: | 1.0.0 |
| Built: | 2026-07-15 13:02:12 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 = TRUE, update_cache = FALSE, cache_dir = NULL, verbose = FALSE )catrnav_atom_get_address( munic, cache = TRUE, update_cache = FALSE, cache_dir = NULL, verbose = FALSE )
munic |
Municipality name, partial name or cadastral code. Use
|
cache |
A logical value indicating whether to use cached files. Defaults
to |
update_cache |
Logical. Should the cached file be refreshed? Defaults to
|
cache_dir |
Path to a cache directory. On |
verbose |
Logical. If |
An sf object, or NULL if the data cannot be
retrieved.
Download data from the ATOM INSPIRE service:
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 table of URLs provided by the Cadastre of Navarre ATOM INSPIRE service for downloading addresses by municipality.
catrnav_atom_get_address_db_all( cache = TRUE, update_cache = FALSE, cache_dir = NULL, verbose = FALSE )catrnav_atom_get_address_db_all( cache = TRUE, update_cache = FALSE, cache_dir = NULL, verbose = FALSE )
cache |
A logical value indicating whether to use cached files. Defaults
to |
update_cache |
Logical. Should the cached file be refreshed? Defaults to
|
cache_dir |
Path to a cache directory. On |
verbose |
Logical. If |
A tibble with the requested information in the following columns:
munic: Municipality name and cadastral code.
url: ATOM URL for the corresponding municipality.
date: Reference date of the data.
Download data from the ATOM INSPIRE service:
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()
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 = TRUE, update_cache = FALSE, cache_dir = NULL, verbose = FALSE )catrnav_atom_get_buildings( munic, cache = TRUE, update_cache = FALSE, cache_dir = NULL, verbose = FALSE )
munic |
Municipality name, partial name or cadastral code. Use
|
cache |
A logical value indicating whether to use cached files. Defaults
to |
update_cache |
Logical. Should the cached file be refreshed? Defaults to
|
cache_dir |
Path to a cache directory. On |
verbose |
Logical. If |
An sf object, or NULL if the data cannot be
retrieved.
Download data from the ATOM INSPIRE service:
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ña") library(ggplot2) ggplot(s) + geom_sf() + labs( title = "Buildings", subtitle = "Pamplona / Iruña" )s <- catrnav_atom_get_buildings("Iruña") library(ggplot2) ggplot(s) + geom_sf() + labs( title = "Buildings", subtitle = "Pamplona / Iruña" )
Creates a table of URLs provided by the Cadastre of Navarre ATOM INSPIRE service for downloading buildings by municipality.
catrnav_atom_get_buildings_db_all( cache = TRUE, update_cache = FALSE, cache_dir = NULL, verbose = FALSE )catrnav_atom_get_buildings_db_all( cache = TRUE, update_cache = FALSE, cache_dir = NULL, verbose = FALSE )
cache |
A logical value indicating whether to use cached files. Defaults
to |
update_cache |
Logical. Should the cached file be refreshed? Defaults to
|
cache_dir |
Path to a cache directory. On |
verbose |
Logical. If |
A tibble with the requested information in the following columns:
munic: Municipality name and cadastral code.
url: ATOM URL for the corresponding municipality.
date: Reference date of the data.
Download data from the ATOM INSPIRE service:
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()
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 = TRUE, update_cache = FALSE, cache_dir = NULL, verbose = FALSE )catrnav_atom_get_parcels( munic, cache = TRUE, update_cache = FALSE, cache_dir = NULL, verbose = FALSE )
munic |
Municipality name, partial name or cadastral code. Use
|
cache |
A logical value indicating whether to use cached files. Defaults
to |
update_cache |
Logical. Should the cached file be refreshed? Defaults to
|
cache_dir |
Path to a cache directory. On |
verbose |
Logical. If |
An sf object, or NULL if the data cannot be
retrieved.
Download data from the ATOM INSPIRE service:
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ña") library(ggplot2) ggplot(s) + geom_sf() + labs( title = "Cadastral Zoning", subtitle = "Pamplona / Iruña" )s <- catrnav_atom_get_parcels("Iruña") library(ggplot2) ggplot(s) + geom_sf() + labs( title = "Cadastral Zoning", subtitle = "Pamplona / Iruña" )
Creates a table of URLs provided by the Cadastre of Navarre ATOM INSPIRE service for downloading cadastral parcels by municipality.
catrnav_atom_get_parcels_db_all( cache = TRUE, update_cache = FALSE, cache_dir = NULL, verbose = FALSE )catrnav_atom_get_parcels_db_all( cache = TRUE, update_cache = FALSE, cache_dir = NULL, verbose = FALSE )
cache |
A logical value indicating whether to use cached files. Defaults
to |
update_cache |
Logical. Should the cached file be refreshed? Defaults to
|
cache_dir |
Path to a cache directory. On |
verbose |
Logical. If |
A tibble with the requested information in the following columns:
munic: Municipality name and cadastral code.
url: ATOM URL for the corresponding municipality.
date: Reference date of the data.
Download data from the ATOM INSPIRE service:
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()
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 = TRUE, update_cache = FALSE, cache_dir = NULL, verbose = FALSE )catrnav_atom_search_munic( munic, cache = TRUE, update_cache = FALSE, cache_dir = NULL, verbose = FALSE )
munic |
Municipality name, partial name or cadastral code to search for. |
cache |
A logical value indicating whether to use cached files. Defaults
to |
update_cache |
Logical. Should the cached file be refreshed? Defaults to
|
cache_dir |
Path to a cache directory. On |
verbose |
Logical. If |
A tibble with the municipality name and cadastral
code, or NULL if no match is found.
Download data from the ATOM INSPIRE service:
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")catrnav_atom_search_munic("Pamplona")
Use this function with caution. It clears cached data and configuration, specifically:
Deletes the CatastRoNav configuration directory
(tools::R_user_dir("CatastRoNav", "config")).
Deletes the cache_dir directory.
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. If |
This function resets the cache state as if you had never used CatastRoNav.
NULL, invisibly. This function is called for its side effects.
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("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. On |
overwrite |
A logical value indicating whether to overwrite an existing
|
install |
Logical. If |
verbose |
Logical. If |
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("CatastRoNav", "config").
catrnav_set_cache_dir() invisibly returns the cache path as a character
string. It is primarily called for its side effect.
catrnav_detect_cache_dir() returns the cache path used in the current
session.
Source files are 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 the corresponding function.
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("CatastRoNav", "config"). Existing configuration files
are migrated automatically. A migration message is shown only once.
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 |
See Bounding box. Can be one of:
|
srs |
CRS to use for the query. Defaults to |
verbose |
Logical. If |
count |
Positive whole number specifying the maximum number of features
to return. If |
An sf object, or 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().
Query data from the WFS INSPIRE service:
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 |
See Bounding box. Can be one of:
|
srs |
CRS to use for the query. Defaults to |
verbose |
Logical. If |
count |
Positive whole number specifying the maximum number of features
to return. If |
An sf object, or 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().
Query data from the WFS INSPIRE service:
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 |
See Bounding box. Can be one of:
|
srs |
CRS to use for the query. Defaults to |
verbose |
Logical. If |
count |
Positive whole number specifying the maximum number of features
to return. If |
An sf object, or 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().
Query data from the WFS INSPIRE service:
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 |
See Bounding box. Can be one of:
|
srs |
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. 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 with three RGB or four RGBA layers, or NULL
when the request cannot be completed. See terra::RGB().
When x is a numeric vector, make sure that srs matches the coordinate
values. When x is an sf or sfc object, srs is ignored.
The query uses EPSG:3857, Web Mercator, then
transforms the image back to the input CRS. If the image appears distorted,
provide a spatial object as x or set srs to the CRS of the requested
image.
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".
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) # 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) # 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)