download_GHSLdata {flexurba}R Documentation

Download data products from the GHSL website

Description

The function will download data products with certain specifications from the Global Human Settlement Layer (GHSL) website. The following data products are supported:

These are also the three data products that are required for the grid cell classification of the Degree of Urbanisation. For more information about the data products and their available specifications, see GHSL Download page. The downloaded data will be saved in the output_directory together with a JSON metadata-file. This function downloads large volumes of data, make sure the timeout parameter is sufficiently high (for example: options(timeout=500)).

Note that the land grid is only available for epoch 2018 and release R2022A on the GHSL website. The land grid will consequently always be downloaded with these specifications, regardless of the epoch and release specified in the arguments (a warning message is printed).

Usage

download_GHSLdata(
  output_directory,
  filenames,
  products = c("BUILT_S", "POP", "LAND"),
  epoch = 2020,
  release = "R2023A",
  crs = 54009,
  resolution = 1000,
  version = c("V1", "0"),
  extent = "global"
)

Arguments

output_directory

character. Path to the output directory

filenames

character. Filenames for the output files

products

vector with the types of the data products: "BUILT_S", "POP" and/or "LAND" for the built-up area grid, the population grid and the land grid respectively

epoch

integer. Epoch

release

character. Release code (only release "R2022A" and "R2023A" are supported)

crs

integer. EPSG code of the coordinate system: for example, 54009 for Mollweide.

resolution

integer. Resolution (in meters for Mollweide projection).

version

vector with the version code and number

extent

character or vector representing the spatial extent. There are three possibilities:

  • extent = "global": The data is downloaded on a global scale.

  • extent is a vector of GHSL tile ids: The data is downloaded for each tile separately and afterwards merged together. For more information about the GHSL tiles and their extent see GHSL_tiles or GHSL Download page.

  • extent = "regions": The data will be downloaded in 9 pre-defined regions. The pre-defined regions are the smallest grouping of GHSL tiles possible while ensuring that no continuous land mass is split over two regions. The regions are constructed to execute the Degree of Urbanisation classification algorithms in a memory-efficient manner. For each of the regions, the data products will be downloaded and saved in a sub-directory of output_directory (e.g., for region W_AME, the directory output_directory/W_AME is created). For more information, see the documentation of GHSL_tiles_per_region.

Value

path to the created files.

Examples


# Download the population grid for epoch 2000 for specific tiles
download_GHSLdata(
  output_directory = tempdir(),
  filename = "POP_2000.tif",
  products = "POP",
  extent = c("R3_C19", "R4_C19"),
  epoch = 2000,
)



[Package flexurba version 0.2.2 Index]