# NOT RUN {
r <- overline(routes_fast_sf[2:5, ], "length")
l <- od2line(od_data_sample[2:5, 1:3], cents_sf)
sln <- stplanr::SpatialLinesNetwork(r)
# calculate shortest paths
plot(sln)
plot(l$geometry, add = TRUE)
sp <- stplanr::route(
l = l,
route_fun = stplanr::route_local,
sln = sln
)
plot(sp["all"], add = TRUE, lwd = 5)
# }
Run the code above in your browser using DataLab