Calculate lists of pair-wise shortest paths between points.
1 2 3 4 5 6 7 8 9
Vector or matrix of points from which route paths are to be calculated (see Details)
Vector or matrix of points to which route paths are to be calculated (see Details)
Type of heap to use in priority queue. Options include
Fibonacci Heap (default;
List of list of paths tracing all connections between nodes such that
x <- dodgr_paths (graph, from, to), then the path between
x [[i]] [[j]].
graph must minimally contain four columns of
dist. If an additional column named
wt is present, shortest paths are calculated according to values
specified in that column; otherwise according to
dist values. Either
way, final distances between
to points are calculated
according to values of
dist. That is, paths between any pair of points
will be calculated according to the minimal total sum of
values (if present), while reported distances will be total sums of
to columns of
graph may be either single
columns of numeric or character values specifying the numbers or names of
graph vertices, or combinations to two columns specifying geographical
(longitude and latitude) coordinates. In the latter case, almost any sensible
combination of names will be accepted (for example,
from_x, from_y, or
to values can be either two-column matrices of
equivalent of longitude and latitude coordinates, or else single columns
precisely matching node numbers or names given in
to is missing, pairwise distances are calculated
between all points specified in
from. If neither
to are specified, pairwise distances are calculated between all nodes
1 2 3 4 5 6 7 8 9 10 11 12 13 14
graph <- weight_streetnet (hampi) from <- sample (graph$from_id, size = 100) to <- sample (graph$to_id, size = 50) dp <- dodgr_paths (graph, from = from, to = to) # dp is a list with 100 items, and each of those 100 items has 30 items, each # of which is a single path listing all vertiex IDs as taken from `graph`. # it is also possible to calculate paths between pairwise start and end # points from <- sample (graph$from_id, size = 5) to <- sample (graph$to_id, size = 5) dp <- dodgr_paths (graph, from = from, to = to, pairwise = TRUE) # dp is a list of 5 items, each of which just has a single path between each # pairwise from and to point.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.