# NOT RUN {
bb = sf::st_bbox(routes_fast)
set.seed(5)
from = c(runif(1, bb$xmin, bb$xmax), runif(1, bb$ymin, bb$ymax))
to = c(runif(1, bb$xmin, bb$xmax), runif(1, bb$ymin, bb$ymax))
sln = SpatialLinesNetwork(routes_fast)
r <- route_local(sln, from, to)
plot(r)
# }
# NOT RUN {
# todo: next code chunk is not currently working:
r2 = route_local(sln = sln, cents_sf[5, ], cents_sf[6, ])
plot(r2)
r_many <- line2route(flowlines_sf[2:9, ], route_local, sln = sln)
plot(cents)
plot(sln@sl, add = TRUE)
plot(r_many, add = TRUE)
# }
Run the code above in your browser using DataLab