if (FALSE) {
library(sf)
apotheke.sf <- st_read(system.file("gpkg/apotheke.gpkg", package = "osrm"),
quiet = TRUE)
# Get a trip with a set of points (sf POINT)
trips <- osrmTrip(loc = apotheke.sf[1:5, ], returnclass = "sf")
mytrip <- trips[[1]]$trip
# Display the trip
plot(st_geometry(mytrip), col = "black", lwd = 4)
plot(st_geometry(mytrip), col = c("red", "white"), lwd = 1, add = TRUE)
plot(st_geometry(apotheke.sf), pch = 21, bg = "red", cex = 1, add = TRUE)
}
Run the code above in your browser using DataLab