Adds the travel routes from the mouth (lowest point) of a river network to each segment, and (optionally) distance lookup tables. This greatly reduces the time needed to detect routes, making distance calculation much more efficient, particularly in the case of multiple distance calculations.
The river network object to use
Whether to build lookup tables as well. This may take
some time, but will result in even faster distance computation in analyses
(see buildlookup). Because of the object size returned, this may
not be advisable in a large river network (more than a few hundred
Whether or not to print the segment number the function is currently building a route for (used for error checking). Defaults to FALSE.
A rivernetwork object, with a new list element,
which gives the route from the mouth to each rivernetwork segment.
Optionally, it may add
$distlookup, distance lookup tables for even
faster distance computation. (See rivernetwork.)
In the event of braiding (multiple channels), it is likely that there will be differences in the routes detected. If this is the case, building routes will likely result in a shorter and more efficient route. Regardless, extreme caution is always advised in the event of braiding.
The mouth segment and vertex must be specified (see setmouth).
This function is called within cleanup, which is recommended in most cases.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
data(abstreams) plot(x=abstreams) abstreams1 <- abstreams abstreams1$segroutes <- NULL #taking out the $segroutes component # before tstart <- Sys.time() detectroute(start=120, end=111, rivers=abstreams1) Sys.time() - tstart # after tstart <- Sys.time() detectroute(start=120, end=111, rivers=abstreams) Sys.time() - tstart
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.