Package 'CatastRoNav'

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

Help Index


ATOM INSPIRE: download all addresses for a municipality

Description

Downloads spatial data for all addresses in a municipality using the ATOM INSPIRE service provided by the Cadastre of Navarre.

Usage

catrnav_atom_get_address(
  munic,
  cache = deprecated(),
  update_cache = FALSE,
  cache_dir = NULL,
  verbose = FALSE
)

Arguments

munic

A single municipality name, partial name or cadastral code. Accepts a character string or numeric code. Use catrnav_atom_search_munic() to search for available municipalities.

cache

[Deprecated] This argument is no longer supported because results are always cached.

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 inside base::tempdir(). See catrnav_set_cache_dir().

verbose

Logical. Whether to display informational messages.

Details

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.

Value

An sf object. Returns NULL if the data cannot be retrieved.

Source

SITNA – Catastro de Navarra

See Also

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()

Examples

s <- catrnav_atom_get_address("Tudela")

library(ggplot2)

ggplot(s) +
  geom_sf() +
  labs(
    title = "Addresses",
    subtitle = "Tudela"
  )

ATOM INSPIRE: list address download URLs

Description

Creates a tibble of URLs provided by the Cadastre of Navarre ATOM INSPIRE service for downloading addresses by municipality.

Usage

catrnav_atom_get_address_db_all(
  cache = deprecated(),
  update_cache = FALSE,
  cache_dir = NULL,
  verbose = FALSE
)

Arguments

cache

[Deprecated] This argument is no longer supported because results are always cached.

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 inside base::tempdir(). See catrnav_set_cache_dir().

verbose

Logical. Whether to display informational messages.

Value

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.

Source

SITNA – Catastro de Navarra

See Also

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()

Examples

catrnav_atom_get_address_db_all()

ATOM INSPIRE: download all buildings for a municipality

Description

Downloads spatial data for all buildings in a municipality using the ATOM INSPIRE service provided by the Cadastre of Navarre.

Usage

catrnav_atom_get_buildings(
  munic,
  cache = deprecated(),
  update_cache = FALSE,
  cache_dir = NULL,
  verbose = FALSE
)

Arguments

munic

A single municipality name, partial name or cadastral code. Accepts a character string or numeric code. Use catrnav_atom_search_munic() to search for available municipalities.

cache

[Deprecated] This argument is no longer supported because results are always cached.

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 inside base::tempdir(). See catrnav_set_cache_dir().

verbose

Logical. Whether to display informational messages.

Details

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.

Value

An sf object. Returns NULL if the data cannot be retrieved.

Source

SITNA – Catastro de Navarra

See Also

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()

Examples

s <- catrnav_atom_get_buildings("Iru<U+00F1>a")

library(ggplot2)

ggplot(s) +
  geom_sf() +
  labs(
    title = "Buildings",
    subtitle = "Pamplona / Iru<U+00F1>a"
  )

ATOM INSPIRE: list building download URLs

Description

Creates a tibble of URLs provided by the Cadastre of Navarre ATOM INSPIRE service for downloading buildings by municipality.

Usage

catrnav_atom_get_buildings_db_all(
  cache = deprecated(),
  update_cache = FALSE,
  cache_dir = NULL,
  verbose = FALSE
)

Arguments

cache

[Deprecated] This argument is no longer supported because results are always cached.

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 inside base::tempdir(). See catrnav_set_cache_dir().

verbose

Logical. Whether to display informational messages.

Value

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.

Source

SITNA – Catastro de Navarra

See Also

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()

Examples

catrnav_atom_get_buildings_db_all()

ATOM INSPIRE: download all cadastral parcels for a municipality

Description

Downloads spatial data for all cadastral parcels in a municipality using the ATOM INSPIRE service provided by the Cadastre of Navarre.

Usage

catrnav_atom_get_parcels(
  munic,
  cache = deprecated(),
  update_cache = FALSE,
  cache_dir = NULL,
  verbose = FALSE
)

Arguments

munic

A single municipality name, partial name or cadastral code. Accepts a character string or numeric code. Use catrnav_atom_search_munic() to search for available municipalities.

cache

[Deprecated] This argument is no longer supported because results are always cached.

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 inside base::tempdir(). See catrnav_set_cache_dir().

verbose

Logical. Whether to display informational messages.

Details

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.

Value

An sf object. Returns NULL if the data cannot be retrieved.

Source

SITNA – Catastro de Navarra

See Also

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()

Examples

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"
  )

ATOM INSPIRE: list cadastral parcel download URLs

Description

Creates a tibble of URLs provided by the Cadastre of Navarre ATOM INSPIRE service for downloading cadastral parcels by municipality.

Usage

catrnav_atom_get_parcels_db_all(
  cache = deprecated(),
  update_cache = FALSE,
  cache_dir = NULL,
  verbose = FALSE
)

Arguments

cache

[Deprecated] This argument is no longer supported because results are always cached.

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 inside base::tempdir(). See catrnav_set_cache_dir().

verbose

Logical. Whether to display informational messages.

Value

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.

Source

SITNA – Catastro de Navarra

See Also

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()

Examples

catrnav_atom_get_parcels_db_all()

ATOM INSPIRE: search for municipalities

Description

Searches for a municipality by name or cadastral code in the Cadastre of Navarre ATOM index.

Usage

catrnav_atom_search_munic(
  munic,
  cache = deprecated(),
  update_cache = FALSE,
  cache_dir = NULL,
  verbose = FALSE
)

Arguments

munic

A single municipality name, partial name or cadastral code. Accepts a character string or numeric code. Use catrnav_atom_search_munic() to search for available municipalities.

cache

[Deprecated] This argument is no longer supported because results are always cached.

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 inside base::tempdir(). See catrnav_set_cache_dir().

verbose

Logical. Whether to display informational messages.

Value

A tibble with the municipality name and cadastral code. Returns NULL if no match is found or the data cannot be retrieved.

See Also

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()

Examples

catrnav_atom_search_munic("Pamplona")

# Search using a numeric cadastral code.
catrnav_atom_search_munic(201)

Clear your CatastRoNav cache directory

Description

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.

Usage

catrnav_clear_cache(config = FALSE, cached_data = TRUE, verbose = FALSE)

Arguments

config

A logical value indicating whether to delete the CatastRoNav configuration directory.

cached_data

If TRUE, deletes your cache_dir and all its contents.

verbose

Logical. Whether to display informational messages.

Details

With config = TRUE and cached_data = TRUE, this function resets the cache state as if you had never used CatastRoNav.

Value

NULL, invisibly. This function is called for its side effects.

See Also

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()

Examples

# 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)

Set your CatastRoNav cache directory

Description

Configures the cache directory used by CatastRoNav. Use Sys.getenv() with "CATASTRONAV_CACHE_DIR" or catrnav_detect_cache_dir() to inspect the current path.

Usage

catrnav_set_cache_dir(
  cache_dir = NULL,
  overwrite = FALSE,
  install = FALSE,
  verbose = TRUE
)

catrnav_detect_cache_dir()

Arguments

cache_dir

Path to a cache directory. If NULL or FALSE, the function stores cached files in a temporary directory. See base::tempdir().

overwrite

A logical value indicating whether to overwrite an existing CATASTRONAV_CACHE_DIR value.

install

Logical. Whether to store the path locally for use in future sessions. Defaults to FALSE.

verbose

Logical. Whether to display informational messages.

Details

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".

Value

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.

Caching strategies

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.

HTTP settings

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.

Note

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.

See Also

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()

Examples

# 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()

WFS INSPIRE: retrieve addresses

Description

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.

Usage

catrnav_wfs_get_address_bbox(x, srs = 4326, verbose = FALSE, count = NULL)

Arguments

x

Input defining the query area. See Bounding box. It can be:

  • A numeric vector of length 4 with the coordinates that define the bounding box: c(xmin, ymin, xmax, ymax).

  • An sf or sfc object from sf.

srs

The CRS to use for the query. Defaults to 4326. See Bounding box.

verbose

Logical. Whether to display informational messages.

count

A positive whole number specifying the maximum number of features to return. If NULL, the service default applies.

Details

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.

Value

An sf object. Returns NULL if the data cannot be retrieved.

API limits

The service returns a maximum of 5,000 features by default. Use count to request a smaller result.

Bounding box

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().

Source

SITNA – Catastro de Navarra

See Also

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()

Examples

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()

WFS INSPIRE: retrieve buildings

Description

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.

Usage

catrnav_wfs_get_buildings_bbox(x, srs = 4326, verbose = FALSE, count = NULL)

Arguments

x

Input defining the query area. See Bounding box. It can be:

  • A numeric vector of length 4 with the coordinates that define the bounding box: c(xmin, ymin, xmax, ymax).

  • An sf or sfc object from sf.

srs

The CRS to use for the query. Defaults to 4326. See Bounding box.

verbose

Logical. Whether to display informational messages.

count

A positive whole number specifying the maximum number of features to return. If NULL, the service default applies.

Details

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.

Value

An sf object. Returns NULL if the data cannot be retrieved.

API limits

The service returns a maximum of 5,000 features by default. Use count to request a smaller result.

Bounding box

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().

Source

SITNA – Catastro de Navarra

See Also

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()

Examples

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()

WFS INSPIRE: retrieve cadastral parcels

Description

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.

Usage

catrnav_wfs_get_parcels_bbox(x, srs = 4326, verbose = FALSE, count = NULL)

Arguments

x

Input defining the query area. See Bounding box. It can be:

  • A numeric vector of length 4 with the coordinates that define the bounding box: c(xmin, ymin, xmax, ymax).

  • An sf or sfc object from sf.

srs

The CRS to use for the query. Defaults to 4326. See Bounding box.

verbose

Logical. Whether to display informational messages.

count

A positive whole number specifying the maximum number of features to return. If NULL, the service default applies.

Details

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.

Value

An sf object. Returns NULL if the data cannot be retrieved.

API limits

The service returns a maximum of 5,000 features by default. Use count to request a smaller result.

Bounding box

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().

Source

SITNA – Catastro de Navarra

See Also

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()

Examples

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()

WMS INSPIRE: download georeferenced map images

Description

Downloads georeferenced map images from the Cadastre of Navarre WMS service. This function wraps mapSpain::esp_get_tiles().

Usage

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,
  ...
)

Arguments

x

Input defining the query area. See Bounding box. It can be:

  • A numeric vector of length 4 with the coordinates that define the bounding box: c(xmin, ymin, xmax, ymax).

  • An sf or sfc object from sf.

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 inside base::tempdir(). See catrnav_set_cache_dir().

verbose

Logical. Whether to display informational messages.

crop

Logical. If TRUE, crop results to the specified x extent. If x is an sf object with one POINT, crop is set to FALSE. See terra::crop().

options

A named list containing additional options to pass to the query.

...

Arguments passed on to mapSpain::esp_get_tiles

res

Character string or number. Only valid for WMS providers. Resolution (in pixels) of the final tile.

bbox_expand

Number. Expansion percentage of the bounding box of x.

transparent

Logical. Whether to use a transparent background, if supported.

mask

Logical. TRUE to mask the result to x. See terra::mask().

Details

Returns NULL if the request cannot run or no image can be retrieved.

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

Layers

The what argument selects one of the following API layers:

  • "parcel": CP.CadastralParcel.

  • "building": BU.Building.

  • "address": AD.Address.

Styles

The WMS service provides different styles for each layer (what argument). Available styles include:

  • "parcel": "default" and "ELFCadastre".

  • "building": "default".

  • "address": "default".

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.

Source

SITNA – Catastro de Navarra

See Also

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

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)