crop_GHSLdata {flexurba}R Documentation

Crop GHSL data to the provided extent

Description

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

Usage

crop_GHSLdata(
  extent,
  output_directory,
  global_directory,
  output_filenames,
  global_filenames,
  buffer = 5
)

Arguments

extent

SpatRaster, or any other object that has a SpatExtent

output_directory

character. Path to the directory to save the cropped grids

global_directory

character. Path to the directory where the global grids are saved (created with download_GHSLdata())

output_filenames

vector of length 3 with the filenames used to save the built-up area, population and land grid in output_directory

global_filenames

vector of length 3 with the filenames of the built-up area, population and land grid in global_directory

buffer

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.

Value

path to the created files.


[Package flexurba version 0.2.2 Index]