Bathymetry does not vary in time, so the same value is attached to every observation at a location regardless of its date.
Usage
attach_bathymetry(dat, bathy, vars = NULL, coords = c("lon", "lat"))Arguments
- dat
a data frame with coordinate columns, or an
sfPOINT object- bathy
a
SpatRasterfromfetch_bathymetry()- vars
which layers to attach;
NULLuses all of them- coords
names of the longitude and latitude columns, ignored for
sfinput
Details
Accepts either a plain data frame with coordinate columns or an sf POINT
object, so it works on observations and on accessEnvDat() output alike.
Examples
if (FALSE) { # \dontrun{
bathy <- fetch_bathymetry(list(xmin = -70, xmax = -66, ymin = 41, ymax = 44))
observations <- attach_bathymetry(observations, bathy, c("DEPTH", "SLOPE"))
} # }