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:
-
BUILT_S: the built-up area grid
-
POP: the population grid
-
LAND: the land grid (with the proportion of permanent land)
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: |
epoch |
integer. Epoch |
release |
character. Release code (only release |
crs |
integer. EPSG code of the coordinate system: for example, |
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:
|
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,
)