Create Urban Greening Opportunities Raster
make_urban_greening_opportunities.RdThis function generates an urban greening opportunities raster by integrating NDVI (Normalized Difference Vegetation Index), land use/land cover (LULC) classification or a pre-computed built areas raster, and urban heat intensity from SDEI/GHS data. It identifies urban pixels with high heat exposure and low greenness for targeted greening interventions.
Uso
make_urban_greening_opportunities(
ndvi_raster,
lulc_raster = NULL,
lulc_product = c("esri_10m", "dynamic_world", "esa_worldcover", "local"),
built_area_lulc_value = NULL,
built_areas_raster = NULL,
sdei_statistics,
threshold = 0.1,
pus,
iso3,
return_urban_areas = FALSE,
output_path = NULL,
cores = 4
)Argumentos
- ndvi_raster
A
SpatRasterrepresenting NDVI values.- lulc_raster
Optional. A
SpatRasterrepresenting land use/land cover (LULC) classes. Required ifbuilt_areas_rasteris not provided.- lulc_product
Character. LULC product used for class value lookups: "esri_10m" (default), "dynamic_world", "esa_worldcover", or "local". When "local",
built_area_lulc_valuemust be explicitly provided.- built_area_lulc_value
Integer or NULL. LULC value representing built-up/urban areas. If NULL, automatically determined from
lulc_product. Default is NULL.- built_areas_raster
Optional. A
SpatRasterrepresenting pre-classified binary built areas (1 = built, 0 = non-built). Skips internal classification fromlulc_raster. Required iflulc_rasteris not provided.- sdei_statistics
An
sfobject with urban heat exposure data (e.g., WBGT statistics).- threshold
Numeric. The fractional threshold (0–1) to classify planning units as urban after aggregation. Planning units with built area fraction above this threshold are considered urban. Default is
0.10.- pus
A
SpatRasterdefining the planning units.- iso3
Character. ISO3 country code used to subset
sdei_statistics.- return_urban_areas
Logical. If
TRUE, returns a two-layer stack with both greening opportunities and binary urban extent.- output_path
Optional. Directory path to save the resulting raster(s).
- cores
Integer. Number of CPU cores to use (for future expansion, currently unused).
Valor
A normalized SpatRaster representing urban greening opportunities.
If return_urban_areas = TRUE, returns a raster stack with both the greening opportunities raster
and the binary built areas raster.
Detalhes
The built areas layer can be sourced either from a precomputed binary raster (built_areas_raster)
or derived dynamically from a LULC raster (lulc_raster), which is classified on-the-fly to extract urban pixels.
When aggregating built areas to planning units, fractional values are thresholded to generate a binary raster
representing urban (1) and non-urban (0) planning units.