detectroute {riverdist} | R Documentation |
Detect Route
Description
Called internally within riverdistance. Detects the sequential route from one river network segment to another.
Usage
detectroute(
start,
end,
rivers,
verbose = FALSE,
stopiferror = TRUE,
algorithm = NULL
)
Arguments
start |
Segment number of the start of the route |
end |
Segment number of the end of the route |
rivers |
The river network object to use |
verbose |
Whether or not to print all routes being considered (used for error checking). Defaults to FALSE. |
stopiferror |
Whether or not to exit with an error if a route cannot be
found. If this is set to |
algorithm |
Which route detection algorithm to use. If set to
|
Value
A vector of segment numbers corresponding to the ordered route.
Author(s)
Matt Tyers
Examples
data(Gulk)
plot(x=Gulk, cex=1)
detectroute(start=6, end=14, rivers=Gulk)
tstart <- Sys.time()
detectroute(start=120, end=111, rivers=abstreams, algorithm="sequential")
tend <- Sys.time()
tend - tstart
data(abstreams)
tstart <- Sys.time()
detectroute(start=120, end=111, rivers=abstreams, algorithm="Dijkstra")
tend <- Sys.time()
tend - tstart
tstart <- Sys.time()
detectroute(start=120, end=111, rivers=abstreams, algorithm="segroutes")
tend <- Sys.time()
tend - tstart