Learn R Programming

flexurba (version 0.2.3)

preprocess_units: Preprocess the data for the DEGURBA spatial units classification

Description

[Deprecated]

preprocess_grid() has been renamed to DoU_preprocess_grid() to create a more consistent API and to better indicate that this function is specifically designed for preprocessing the units data to reconstruct the DEGURBA classification with DoU_classify_units().

Usage

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

Value

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

  • classification: the (resampled and cropped) grid cell classification layer

  • pop: the (resampled and cropped) population grid

  • units: the (dissolved and filtered) spatial units (object of class sf)

  • metadata: named list with the metadata of the input files. It contains the elements units, classification and pop (with paths to the respective data sources), resample_resolution and dissolve_units_by if not NULL. (Note that when the input sources are passed by object , the metadata might be empty).

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