Learn R Programming

stplanr (version 0.1.4)

line2route: Convert straight SpatialLinesDataFrame from flow data into routes

Description

Convert straight SpatialLinesDataFrame from flow data into routes

Usage

line2route(l, route_fun = "route_cyclestreet", n_print = 10, ...)

Arguments

l
A SpatialLinesDataFrame
route_fun
A routing function to be used for converting the straight lines to routes od2line
n_print
A number specifying how frequently progress updates should be shown
...
Arguments passed to the routing function, e.g. route_cyclestreet

Details

See route_cyclestreet and other route functions for details

Examples

Run this code

## Not run: 
# plot(flowlines)
# rf <- line2route(l = flowlines, "route_cyclestreet", plan = "fastest")
# rq <- line2route(l = flowlines, plan = "quietest", silent = TRUE)
# plot(rf, col = "red", add = TRUE
# plot(rq, col = "green", add = TRUE
# # Plot for a single line to compare 'fastest' and 'quietest' route
# n = 21
# plot(flowlines[n,])
# lines(rf[n,], col = "red")
# lines(rq[n,], col = "green")
# ## End(Not run)

Run the code above in your browser using DataLab