Summarise links from shortest paths data
The SpatialLinesNetwork or sfNetwork to use.
A dataframe where the first column contains the Node ID(s) of the start of the routes, the second column indicates the Node ID(s) of the end of the routes, and any additional columns are summarised by link. If there are no additional colums, then overlapping routes are counted.
Find the shortest path on the network between specified nodes and returns a SpatialLinesDataFrame or sf containing the path(s) and summary statistics of each one.
1 2 3 4 5 6 7 8 9 10 11 12
data(routes_fast) rnet <- overline(routes_fast, attrib = "length") SLN <- SpatialLinesNetwork(rnet) weightfield(SLN) # field used to determine shortest path shortpath <- sum_network_links( SLN, data.frame( start=rep(c(1,2,3,4,5),each=4), end=rep(c(50,51,52,33),times=5) ) ) plot(shortpath, lwd=shortpath$count)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.