View source: R/shortest_path_cppRouting.R
shortest_path_cppRouting | R Documentation |
The function shortest_path_cppRouting
can be used to calculate the shortest path (either in minutes or meters) between two or more nodes in the Norwegian road network. The function also works with vectors with multiple from and to node ID’s.
Before the function can be used, the road network must be converted to a cppRouting
object that is called graph_cppRouting_minutes
or graph_cppRouting_meters
(or other with other names supplied to the graph_cppRouting_object
argument). This can be done with the function vegnett_to_R()
.
shortest_path_cppRouting( from_node_ID, to_node_ID, unit = "minutes", dist = "all", graph_cppRouting_object = graph_cppRouting_minutes )
from_node_ID |
Numeric vector with one or more from node ID’s. |
to_node_ID |
Numeric vector with one or more to node ID’s. |
unit |
Character vector with |
dist |
Character vector that specifies if all the shortest paths between all the supplied from and to nodes are returned ( |
graph_cppRouting_object |
The road network structured as a |
Object (data.frame
) with how many minutes or meters the shortest path is between the supplied from and to node ID’s.
shortest_path_cppRouting(from = 25, to = 33, unit = "minutes", graph_cppRouting_object = graph_cppRouting_minutes_sampledata) shortest_path_cppRouting(from = 25, to = 33, unit = "meters", graph_cppRouting_object = graph_cppRouting_meters_sampledata) shortest_path_cppRouting(from = 25, to = c(32, 33), unit = "minutes", dist = "min", graph_cppRouting_object = graph_cppRouting_minutes_sampledata)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.