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)
x | Spatial* object |
---|---|
mask | Raster* object |
Raster* 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) raster::plot(dist_wb)