The grid cell classification of the Degree of Urbanisation requires three different inputs: a built-up area grid, a population grid, and a land grid. The grids can be downloaded from the GHSL website with download_GHSLdata().
This function reads the downloaded grids from the global_directory and crops them to the provided extent. The newly cropped grids will be saved in the output_directory, together with their respective metadata (in JSON format).
crop_GHSLdata(
extent,
output_directory,
global_directory,
output_filenames,
global_filenames,
buffer = 5
)path to the created files.
SpatRaster, or any other object that has a SpatExtent
character. Path to the directory to save the cropped grids
character. Path to the directory where the global grids are saved (created with download_GHSLdata())
vector of length 3 with the filenames used to save the built-up area, population and land grid in output_directory
vector of length 3 with the filenames of the built-up area, population and land grid in global_directory
integer. If larger than 0, a buffer of buffer cells will be added around the borders of the extent to allow cities or towns at the edges to be correctly classified.