prepare_popmaps_surface() records the scientific meaning of a raster before
it is used for POPMAPS interpolation or surface comparison. Geographic
surfaces (surface = "G") use only the raster geometry. Suitability- or
conductance-weighted surfaces (surface = "C") use raster values to define
relative movement or gene-flow connectivity.
This helper creates a validated surface object for modern least-cost interpolation, tuning, and candidate-surface comparison workflows.
Arguments
- input_raster
A
terra::SpatRaster, legacyraster::RasterLayer, or path to a raster file.- surface
Character.
"G"uses raster geometry only."C"uses raster values as a conductance-like landscape surface.- surface_values
Character. Meaning of raster values when
surface = "C"."suitability"and"conductance"use values directly;"resistance"converts values to conductance using an inverse transform. Ignored whensurface = "G".- mask
Optional raster with the same geometry as
input_raster. Non-zero, non-NAcells mark cells eligible for prediction. This is kept separate from conductance because a prediction mask is not necessarily a movement barrier.- barrier
Optional raster with the same geometry as
input_raster. Non-zero, non-NAcells mark cells that should be treated as non-traversable in modern least-cost workflows.- rescale_conductance
Logical. If
TRUE, divide conductance by the largest non-missing conductance value after any resistance conversion. This preserves zero-valued barriers while putting the maximum conductance on a 0-1 scale. The default isFALSEto preserve legacy POPMAPS behavior for MaxEnt logistic suitability rasters.- resistance_epsilon
Positive numeric scalar added to resistance values before inversion to avoid infinite conductance when resistance is zero.