Distances are computed on geographic coordinates with the sf/S2 spherical
geometry engine. coast_dist() enables S2 only for the duration of the
geometry calculation and restores the caller's existing sf::sf_use_s2()
setting afterward. For line geometries the result is the shortest distance
to the line; for polygon geometries points inside or on the boundary have
zero distance.
Arguments
- x
An
<ocean_cube>object.- coast
Either an
sf/sfcobject or a path readable bysf::st_read().