classify_grid_urban_centres() has been renamed to DoU_classify_grid_urban_centres() to create a more consistent API and to better indicate that this function is specifically designed to classify urban centres in the context of the DEGURBA classification.
classify_grid_urban_centres(
data,
density_threshold = 1500,
size_threshold = 50000,
contiguity_rule = 4,
built_criterium = TRUE,
built_threshold = 0.2,
smooth_pop = FALSE,
smooth_pop_window = 5,
gap_fill = TRUE,
max_gap = 15,
smooth_edge = TRUE,
smooth_edge_fun = "majority_rule_R2023A",
value = 3
)SpatRaster with the grid cell classification of urban centres
path to the directory with the data, or named list with the data as returned by function DoU_preprocess_grid()
numeric. Minimum population density per permanent land of a cell required to belong to an urban centre
numeric. Minimum total population size required for an urban centre
integer. Which cells are considered adjacent: 4 for rooks case (horizontal and vertical neighbours) or 8 for queens case (horizontal, vertical and diagonal neighbours)
logical. Whether to use the additional built-up area criterium (see details). If TRUE, not only cells that meet the population density requirement will be considered when delineating urban centres, but also cells with a built-up area per permanent land above the built_threshold
numeric. Additional built-up area threshold. A value between 0 and 1, representing the minimum built-up area per permanent land. Ignored when built_criterium is FALSE.
logical. Whether to smooth the population grid before delineating urban centres. If TRUE, the population grid will be smoothed with a moving average of window size smooth_pop_window.
integer. Size of the moving window used to smooth the population grid before delineating urban centres. Ignored when smooth_pop is FALSE.
logical. Whether to perform gap filling. If TRUE, gaps in urban centres smaller than max_gap are filled.
integer. Gaps with an area smaller than this threshold in urban centres will be filled (unit is km²). Ignored when gap_fill is FALSE.
logical. Whether to perform edge smoothing. If TRUE, edges of urban centres are smoothed with the function smooth_edge_fun.
character / function. Function used to smooth the edges of urban centres. Ignored when smooth_edge is FALSE. Possible values are:
"majority_rule_R2022A" to use the edge smoothing algorithm in GHSL Data Package 2022 (see details)
"majority_rule_R2023A" to use the edge smoothing algorithm in GHSL Data Package 2023 (see details)
a custom function with a signature similar as apply_majority_rule().
integer. Value assigned to urban centres in the resulting grid