Create a Standardised Raster of Key Biodiversity Areas (KBAs)
make_kbas.RdThis function processes a Key Biodiversity Areas (KBA) vector dataset and converts it into
a normalised raster aligned with the input planning units. It allows for filtering to
include or exclude Alliance for Zero Extinction (AZE) sites, as well as optionally excluding
KBAs marked as "Regional". By default, it includes all KBAs except regional-only sites.
It can also be used to return only AZE sites if aze_only = TRUE.
Uso
make_kbas(
kba_in,
pus,
iso3,
include_aze_sites = FALSE,
aze_only = FALSE,
include_regional_kba = FALSE,
buffer_points = TRUE,
area_column = "repareakm2",
nQuadSegs = 50,
output_path = NULL
)Argumentos
- kba_in
An
sfobject containing KBA vector features, including columns likeiso3,azestatus, andkbaclass.- pus
A
SpatRasterobject representing planning units (reference extent and resolution).- iso3
A character string representing the 3-letter ISO country code (e.g., "KEN").
- include_aze_sites
Logical. If
TRUE, includes KBAs that are also AZE sites (default isFALSE).- aze_only
Logical. If
TRUE, returns only confirmed AZE sites (default isFALSE).- include_regional_kba
Logical. If
FALSE, filters out KBAs marked as "Regional" or "Global/ Regional to be determined".- buffer_points
Logical. If
TRUE, circular buffers are generated around point geometries using thearea_columnattribute (default isTRUE).- area_column
A string indicating the name of the column containing the reported area for point geometries (in km²), used when buffering points. The default
"repareakm2"is the KBA dataset's column for points with reported areas. Note:sitareakm2contains site area for polygon features but is typically NA for points.- nQuadSegs
An integer specifying the number of segments used to approximate circular buffers (default: 50).
- output_path
Optional character. Directory path to save the output raster. If
NULL, output is not written to file.