stplanr (version 0.3.1)

sum_network_routes: Summarise shortest path between nodes on network

Description

Summarise shortest path between nodes on network

Usage

sum_network_routes(sln, start, end, sumvars, combinations = FALSE)

Arguments

sln

The SpatialLinesNetwork to use.

start

Node ID(s) of route starts.

end

Node ID(s) of route ends.

sumvars

Character vector of variables for which to calculate summary statistics.

combinations

Boolean value indicating if all combinations of start and ends should be calculated. If TRUE then every start Node ID will be routed to every end Node ID. This is faster than passing every combination to start and end. Default is FALSE.

Details

Find the shortest path on the network between specified nodes and returns a SpatialLinesdataFrame containing the path(s) and summary statistics of each one.

See Also

Other rnet: SpatialLinesNetwork, calc_catchment_sum, calc_catchment, calc_moving_catchment, calc_network_catchment, find_network_nodes, gsection, islines, lineLabels, overline2, overline, plot,SpatialLinesNetwork,ANY-method, plot,sfNetwork,ANY-method, sln2points, sum_network_links

Examples

Run this code
# NOT RUN {
sln <- SpatialLinesNetwork(route_network)
weightfield(sln) # field used to determine shortest path
shortpath <- sum_network_routes(sln, start = 1, end = 50, sumvars = "length")
plot(shortpath, col = "red", lwd = 4)
plot(sln, add = TRUE)
# }

Run the code above in your browser using DataLab