if (FALSE) {
# Inputs are data frames
apotheke.df <- read.csv(system.file("csv/apotheke.csv", package = "valh"))
pts1 <- apotheke.df[1:6, c("lon", "lat")]
# Compute the optimized route between the first 6 points
# (starting point, 4 waypoints and final destination), by bike
trip1a <- vl_optimized_route(loc = pts1, end_at_start = FALSE, costing = "bicycle")
# Compute the optimized route between the first 6 points returning to the
# starting point, by bike
trip1b <- vl_optimized_route(loc = pts1, end_at_start = TRUE, costing = "bicycle")
# Inputs are sf points
library(sf)
apotheke.sf <- st_read(system.file("gpkg/apotheke.gpkg", package = "valh"),
quiet = TRUE
)
pts2 <- apotheke.sf[1:6, ]
# Compute the optimized route between the first 6 points
# (starting point, 4 waypoints and final destination)
trip2a <- vl_optimized_route(loc = pts2, end_at_start = FALSE, costing = "auto")
# Compute the optimized route between the first 6 points, returning to the
# starting point
trip2b <- vl_optimized_route(loc = pts2, end_at_start = TRUE, costing = "auto")
}
Run the code above in your browser using DataLab