distance_to_vector.Rd
Compute a raster file with the distances to the nearest vector feature, within the limits of a given mask.
distance_to_vector(x, mask)
SpatVector object, or something convertible to.
SpatRaster object
SpatRaster object. Distance map in meters (even for unprojected maps in geographical coordinates).
The resolution of the mask determines that of the outcome.
cmr <- mapMCDA_datasets()
dist_wb <- distance_to_vector(cmr$water_bodies, cmr$animal.density)
#>
|---------|---------|---------|---------|
=========================================
plot(dist_wb)