Check if a segment runs parallel to latitude or longitude
characterise_flows.Rd
This function checks whether the transects created to sample the boundaries of model compartments lie on a lat-lon grid. If they do, then we know that when sampling meridional and zonal currents only one is needed per transect.
Arguments
- lines
An sfc object of lines representing transects along the perimeter of a model domain polygon.
- domain
An sfc polygon object of the model domain, used to make the transects.
- precision
How far apart should sampling points be (1/x degrees, larger numbers bring the points closer).
- segment
An SF line object representing a transect along the perimeter of a model domain polygon.
Value
The function returns a dataframe detailing whether laitudues are the same and longitudes are the same along a segment.
The function returns a dataframe detailing which two model compartments are either side of the transect, and the direction of the exchange.
The function returns the lines object with added columns. If transects are ambiguosly labelled, a list is returned of the transects and the failed sampling locations.
Details
The function takes a boundary segment (transect) and reprojects it on a lat-lon grid. The coordinates are extracted, and checked for identical latitudes or longitudes.
See also
Other Boundary sampling functions:
boundaries()
,
to_segments()