LOStest | R Documentation |
Determines whether land is obstructing a direct path between two pairs of ocean coordinates.
LOStest(pts.ocean, buffer = 0.025, toplot = TRUE)
pts.ocean |
A list containing two coordinate pairs. Format: |
buffer |
Distance (in decimal degrees) to increase the boundaries of shoreline under consideration beyond the range defined by the two points. |
toplot |
If |
A test function used frequently throughout the routeKFS
function, but can be used on its own for any part of the
northeast Pacific coastline (Oregon to Alaska). The function takes a shoreline dataset from the package PBSmapping
,
and explores nearby shoreline vertices (in pairs) to see if the line connecting them intersects
with a straight path between the two ocean points in question. Then, if the solution of the two lines
is contained with a box that bounds the two shoreline vertices, the function concludes that
the shore must be obstructing line of sight.
Returns a two element list. The first list is a Boolean: If TRUE
,
then the two points are indeed line-of-sight with no shore obstructions. If FALSE
,
then the land is obstructing the most direct path between the points.
The second element in the list is a 2-element vector, the X and Y of the intersection point with shore.
This vector is c(NA,NA)
when the two points are line of sight.
Eric Keen, Scripps Institution of Oceanography, ekeen@ucsd.edu
whalemap
, routeKFS
, solve2lines
### Define the two ocean pts
xO1 <- -129.3
yO1 <- 53.3
xO2 <- -129.23
yO2 <- 53.33
# Combine into list
pts.ocean <- list(c(xO1,yO1),c(xO2,yO2))
# Run the test:
LOStest(pts.ocean)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.