Skip to contents

The JRC Global Human Settlement Layer GHS-BUILT-S (built-up surface, m2 per 100 m cell; e.g. GHS_BUILT_S_E2030_GLOBE_R2023A_54009_100_V1_0.tif, ~2.8 GB, from https://ghsl.jrc.ec.europa.eu) is too large to query directly. This builds, once, two ~1 km (30 arc-second) layers in longitude/latitude: the mean built-up m2 per 100 m cell (settlement density; divided by 100 it is the built-up %) and the maximum (the most built 100 m cell, i.e. a building nearby). Use them as ghs_mean and ghs_max in filter_layers(). Needs the sf package (GDAL); takes several minutes.

Usage

aggregate_ghs(ghs_file, path, extent = c(-180, -60, 180, 85), res = 1/120)

Arguments

ghs_file

Path to the GHS-BUILT-S GeoTIFF.

path

Output folder.

extent

Output extent c(xmin, ymin, xmax, ymax) in degrees; restrict it to your region to save time and space.

res

Output resolution in degrees (default 30 arc-seconds).

Value

A named character vector with the paths of the mean and max layers.

Examples

if (FALSE) { # \dontrun{
ghs <- aggregate_ghs("GHS_BUILT_S_E2030_GLOBE_R2023A_54009_100_V1_0.tif",
                     "data", extent = c(-25, 35, 45, 72))
lay <- filter_layers(ghs_mean = ghs[["mean"]], ghs_max = ghs[["max"]])
} # }