Calculate the 'in-sea' distance between polygons
Source:R/calc_in_sea_distance.R
calc_in_sea_distance.Rd
Calculate the 'in-sea' distance between polygons
Usage
calc_in_sea_distance(
cellsize = 1000,
bioregion,
areas,
units = "km",
crs = paste0("+proj=aeqd +lon_0=", st_coordinates(st_centroid(bioregion))[1, 1],
" +lat_0=", st_coordinates(st_centroid(bioregion))[1, 2],
" +datum=WGS84 +units=m +no_defs")
)
Arguments
- cellsize
numeric with target cellsize in meters of hexagonal cells the distance between opposite edges. The edge length is cellsize/sqrt(3))
- bioregion
sf polygon of the study area (i.e. the sea!)
- areas
sf polygons among which to calculate distances. e.g. protected areas
- units
character string for output distance matrix. Either "m" or "km" (by default).
- crs
target coordinate reference system: object of class crs, or input string for st_crs