Skip to contents

CatastRoNav is a package that provides access to different INSPIRE API services of the Cadastre of Navarre. With CatastRoNav, you can download spatial objects such as buildings or cadastral parcels.

INSPIRE Services

The INSPIRE Directive aims to create a European Union spatial data infrastructure for the purposes of EU environmental policies and policies or activities which may have an impact on the environment. This European Spatial Data Infrastructure will enable the sharing of environmental spatial information among public sector organisations, facilitate public access to spatial information across Europe and assist in policy-making across boundaries.

From https://knowledge-base.inspire.ec.europa.eu/index_en

The implementation of the INSPIRE directive on the Cadastre of Navarre allows retrieving spatial objects from the cadastre database:

  • Vector objects: Parcels, addresses, buildings, cadastral zones and more. These objects are provided by CatastRoNav as sf objects (see ?sf::st_sf).

Examples

In this example, we retrieve the cadastral parcels of Olite:

library(CatastRoNav)
# For obtaining coordinates
library(sf)
library(mapSpain)
# Data wrangling and visualization
library(dplyr)
library(ggplot2)

olite <- esp_get_capimun(munic = "Olite") |>
  st_transform(25830) |>
  # Small buffer of 100 m
  st_buffer(100)


cp <- catrnav_wfs_get_parcels_bbox(olite)

ggplot(cp) +
  geom_sf()
Figure 1: Example - Olite

Figure 1: Example - Olite

Thematic maps

We can also create thematic maps using information available in the spatial objects. Here we produce a visualization of the urban growth of Pamplona using CatastRoNav, replicating the map produced by Dominic Royé (Royé 2019).

First, we extract the coordinates of the city center of Pamplona using mapSpain:

# Use mapSpain to obtain coordinates
pamp <- esp_get_capimun(munic = "^Pamplona")

# Transform to ETRS89 / UTM 30 N and add a buffer of 750m

pamp_buff <- pamp |>
  st_transform(25830) |>
  st_buffer(1250)

The next step is to extract buildings using the WFS service:

pamp_bu <- catrnav_wfs_get_buildings_bbox(pamp_buff, count = 10000)

Then crop the buildings to the buffer created earlier:

# Cut buildings

dataviz <- st_intersection(pamp_bu, pamp_buff)

ggplot(dataviz) +
  geom_sf()
Figure 2: Minimal map of Pamplona

Figure 2: Minimal map of Pamplona

Next, extract the construction year from the beginning column.

# Extract 4 initial positions
year <- substr(dataviz$beginning, 1, 4)

# Replace values that do not look like numbers with "0000".
year[!(year %in% 0:2500)] <- "0000"

# Convert to numeric
year <- as.integer(year)

# Create new column
dataviz <- dataviz |>
  mutate(year = year)

The last step is to group the data by year and build the visualization. Here we use the function ggplot2::cut_width() to create classes:

dataviz <- dataviz |>
  mutate(year_cat = ggplot2::cut_width(year, width = 10, dig.lab = 12))

# Adjust the color palette

dataviz_pal <- hcl.colors(length(levels(dataviz$year_cat)), "Spectral")

ggplot(dataviz) +
  geom_sf(aes(fill = year_cat), color = NA) +
  scale_fill_manual(values = dataviz_pal) +
  theme_void() +
  labs(title = "PAMPLONA", fill = "") +
  theme(
    panel.background = element_rect(fill = "black"),
    plot.background = element_rect(fill = "black"),
    legend.justification = .5,
    legend.text = element_text(
      colour = "white",
      size = 12
    ),
    plot.title = element_text(
      colour = "white", hjust = .5,
      margin = margin(t = 30),
      size = 30
    ),
    plot.caption = element_text(
      colour = "white",
      margin = margin(b = 20), hjust = .5
    ),
    plot.margin = margin(r = 40, l = 40)
  )
Figure 3: Pamplona - Urban Growth

Figure 3: Pamplona - Urban Growth

References

Royé, Dominique. 2019. Visualize Urban Growth. https://dominicroye.github.io/blog/visualize-urban-growth/.