Calculate habitat connectivity with visualization data
Source:R/terra-connectivity.R
habitat_connectivity_full.RdLike habitat_connectivity(), but also returns the intermediate rasters
(buffered habitat, patch ID raster, barrier mask, remaining habitat) useful
for mapping and reporting.
Arguments
- habitat
Terra SpatRaster. Habitat raster.
- barrier
Terra SpatRaster. Barrier raster.
- interpatch_distance
Numeric. The distance (in meters) where habitat patches are considered connected. E.g., if set to 500, patches 498m apart are connected, those 501m apart are not connected. This is passed internally to a spatial operation known as "buffering", where this distance is used as a radius from the edge of the habitat zone. This means the specified
interpatch_distanceis halved exactly. So an interpatch distance of 500 will be converted to 250. For the buffer to be representable on the raster, keepresolution <= interpatch_distance / 2; below that the buffer is a no-op and a warning is raised. Seevignette("interpatch-distance-and-resolution").- verbose
Logical. Display progress messages (default: TRUE).
Value
Named list with elements: buffered_habitat, patch_id_raster,
areas_connected, barrier_mask, remaining_habitat.
Examples
lizard_habitat <- example_habitat()
lizard_barrier <- example_barrier()
result <- habitat_connectivity_full(
lizard_habitat,
lizard_barrier,
interpatch_distance = 10,
verbose = FALSE
)
names(result)
#> [1] "buffered_habitat" "patch_id_raster" "areas_connected"
#> [4] "barrier_mask" "remaining_habitat"