Convert straight OD data (desire lines) into routes
Convert straight OD data (desire lines) into routes
line2route( l, route_fun = stplanr::route_cyclestreets, n_print = 10, list_output = FALSE, l_id = NA, time_delay = 0, ... )
l |
A spatial (linestring) object |
route_fun |
A routing function to be used for converting the straight lines to routes
|
n_print |
A number specifying how frequently progress updates should be shown |
list_output |
If FALSE (default) assumes spatial (linestring) object output. Set to TRUE to save output as a list. |
l_id |
Character string naming the id field from the input lines data, typically the origin and destination ids pasted together. If absent, the row name of the straight lines will be used. |
time_delay |
Number or seconds to wait between each query |
... |
Arguments passed to the routing function, e.g. |
See route_cyclestreets()
and other route functions for details.
A parallel implementation of this was available until version 0.1.8.
Other routes:
line2routeRetry()
,
route_dodgr()
,
route_local()
,
route_osrm()
,
route_transportapi_public()
,
route()
## Not run: # does not run as requires API key l <- flowlines[2:5, ] r <- line2route(l) rq <- line2route(l = l, plan = "quietest", silent = TRUE) rsc <- line2route(l = l, route_fun = cyclestreets::journey) plot(r) plot(r, col = "red", add = TRUE) plot(rq, col = "green", add = TRUE) plot(rsc) plot(l, add = T) # Plot for a single line to compare 'fastest' and 'quietest' route n <- 2 plot(l[n, ]) lines(r[n, ], col = "red") lines(rq[n, ], col = "green") ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.