Create a Binary or Fractional Raster of Protected Areas Aligned to Planning Units
make_protected_areas.RdGenerates a raster of protected areas for a given country, aligned to the planning
units. Data can be downloaded from the Protected Planet
database via the wdpar package, or provided as an sf object.
Utilisation
make_protected_areas(
pus,
iso3,
from_wdpca = TRUE,
sf_in = NULL,
download_path = NULL,
status = c("Established", "Inscribed", "Designated"),
site_type = "PA",
pa_def = deprecated(),
include_mab_designation = FALSE,
buffer_points = TRUE,
area_column = "REP_AREA",
area_calc_crs = "ESRI:54009",
n_quad_segs = 50,
binary = TRUE,
threshold = 0.1,
force_update = FALSE,
output_path = NULL
)Arguments
- pus
SpatRaster. Planning units raster defining the output resolution and extent.
- iso3
Character. ISO3 country code (e.g., "CHL").
- from_wdpca
Logical. If
TRUE, downloads protected area data using the wdpar package. IfFALSE, usessf_in. Default isTRUE.- sf_in
sf object or NULL. Protected area geometries to use when
from_wdpca = FALSE. Required iffrom_wdpca = FALSE.- download_path
Character or NULL. Directory where WDPCA data will be saved or loaded from. Required if
from_wdpca = TRUE.- status
Character vector. Which
STATUSvalues to include from WDPCA data. Valid values: "Designated", "Established", "Inscribed", "Proposed", "Adopted". Default isc("Established", "Inscribed", "Designated").- site_type
Character vector. Values for the
SITE_TYPEcolumn in WDPCA data. Valid values: "PA" (Protected Area) or "OECM" (Other Effective Area-based Conservation Measure). Default is"PA". For backward compatibility, numeric values 1 (PA) and 0 (OECM) are also accepted.- pa_def
Deprecated. Use
site_typeinstead. Kept for backward compatibility.- include_mab_designation
Logical. If
FALSE, excludes UNESCO Man andBiosphere (MAB) reserves. Default is
FALSE.- buffer_points
Logical. If
TRUE, creates geodesic buffers around point geometries using the area attribute. Default isTRUE.- area_column
Character. Column name containing area values for buffering point geometries. Default is
"REP_AREA".- area_calc_crs
Character. CRS to use for buffer calculations. Default is
"ESRI:54009"(World Mollweide).- n_quad_segs
Integer. Number of segments per quarter circle when creating buffers. Default is
50.- binary
Logical. If
TRUE, output is binary (0/1) based onthreshold. IfFALSE, returns fractional coverage. Default isTRUE.- threshold
Numeric. Coverage fraction threshold for binary classification. Planning units with coverage above this value are classified as protected. Only used when
binary = TRUE. Default is0.10.- force_update
Logical. If
TRUE, forces re-download of WDPCA data even if cached. Default isFALSE.- output_path
Character or NULL. Directory to save the output raster. If NULL, the raster is returned but not saved.