routeKFS | R Documentation |
Determines the shortest traveling distance (i.e., swimming distance) between two points within the archipelago of the Kitimat Fjord System.
routeKFS(
x1,
y1,
x2,
y2,
buffer = 0.01,
show.progress = TRUE,
plot.route = TRUE,
plot.los = FALSE,
print.turns = TRUE
)
x1 |
Longitude of first point (negative decimal degrees) |
y1 |
Latitude of first point |
x2 |
Longitude of second point |
y2 |
Latitude of second point |
buffer |
Passed to |
show.progress |
When |
plot.route |
When |
plot.los |
Plotting toggle passed to the function |
print.turns |
When |
An (imperfect) calculation of ecologically relevant distances between locations in the Kitimat Fjord System.
Returns a two-element list: [[1]] the shortest possible swimming distance (km) between the two given points, and [[2]] the dataframe of turns with column names X and Y.
Eric Keen, Scripps Institution of Oceanography, ekeen@ucsd.edu
whalemap
, LOStest
, solve2lines
############ How far from Caamano Sound to Amy Point?
x1 <- -129.4 # Caamano Sound
y1 <- 52.9
x2 <- -129.006958 # Amy Pt, north tip of Gribbell
y2 <- 53.53864484
routeKFS(x1,y1,x2,y2) # Find distance
############
############ How far from Glide Island to Bishop Bay?
x1 <- -128.8489429 # Glide Island:
y1 <- 53.47139178
x2 <- -129.48349 # Bishop Bay:
y2 <- 53.01519634
routeKFS(x1,y1,x2,y2) # Find distance
############
############ A straight-shot case: South Douglas to Central Wright
############ No maps or printing:
x1 <- -129.2 # Near Hartley Bay
y1 <- 53.35
x2 <- -129.22890579 # Wright Sound
y2 <- 53.41901713
routeKFS(x1,y1,x2,y2,plot.route=FALSE,show.progress=FALSE,print.turns=FALSE) # Find distance
############
############ Threading the Casanave needle: Loredo to Leading Pt
x1 <- -129.19 # Loredo
y1 <- 52.84
x2 <- -129.15 # Leading Pt
y2 <- 53.25
routeKFS(x1,y1,x2,y2) # Find distance
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.