DoU_preprocess_units {flexurba}R Documentation

Preprocess the data for the DEGURBA spatial units classification

Description

The spatial units classification of the Degree of Urbanisation requires three different inputs (all input sources should be in the Mollweide coordinate system):

The three input layers are pre-processed as follows. The classification grid and population grid are resampled to the resample_resolution with the nearest neighbour algorithm. In doing this, the values of the population grid are divided by the oversampling ratio (for example: going from a resolution of 100 m to a resolution of 50 m, the values of the grid are divided by 4).

In addition, the function makes sure the extents of the three input layers match. If the bounding box of the units layer is smaller than the extent of the grids, then the grids are cropped to the bounding box of the units layer. Alternatively, if the units layer covers a larger area than the grids, then the units that do not intersect with the grids are discarded (and a warning message is printed). This ensures that the classification algorithm runs efficiently and does not generate any incorrect classifications due to missing data.

More information about the pre-processing workflow, see GHSL Data Package 2023 (Section 2.7.2.3).

Usage

DoU_preprocess_units(
  units,
  classification,
  pop,
  resample_resolution = NULL,
  dissolve_units_by = NULL
)

Arguments

units

character / object of class sf. Path to the vector layer with small spatial units, or an object of class sf with the small spatial units

classification

character / SpatRaster. Path to the grid cell classification of the Degree of Urbanisation, or SpatRaster with the grid cell classification

pop

character / SpatRaster. Path to the population grid, or SpatRaster with the population grid

resample_resolution

numeric. Resolution to which the grids are resampled during pre-processing. If NULL, the grids are resampled to the smallest resolution among the population and classification grid.

dissolve_units_by

character. If not NULL, the units are dissolved by this column's value, can for example be used to dissolve spatial units to a certain administrative level (see examples).

Value

named list with the required data to execute the spatial units classification procedure, and their metadata. The list contains the following elements:

Examples


# load the grid data
grid_data <- flexurba::DoU_load_grid_data_belgium()
# load the units and filter for West-Flanders
units_data <- flexurba::units_belgium %>%
  dplyr::filter(GID_2 == "30000")
# classify the grid
classification <- DoU_classify_grid(data = grid_data)

# preprocess the data for units classification
data1 <- DoU_preprocess_units(
  units = units_data,
  classification = classification,
  pop = grid_data$pop,
  resample_resolution = 50
)

# preprocess the data for units classification at level 3 (Belgian districts)
data2 <- DoU_preprocess_units(
  units = units_data,
  classification = classification,
  pop = grid_data$pop,
  resample_resolution = 50,
  dissolve_units_by = "GID_3"
)


[Package flexurba version 0.2.2 Index]