View source: R/get_summ_route.R
get_summ_route | R Documentation |
This function is a wrapper for the Route Service API. It is similar to get_route
, except it returns a tibble with only total time and total distance, and also optionally, the start coordinates and end coordinates.
If route = "pt"
, only the best route is chosen (i.e. n_itineraries = 1
).
get_summ_route( token, start, end, route, date = Sys.Date(), time = format(Sys.time(), format = "%T"), mode = NULL, max_dist = NULL, route_geom = FALSE )
token |
User's API token. This can be retrieved using |
start |
Vector of c(lat, lon) coordinates for the route start point |
end |
Vector of c(lat, lon) coordinates for the route end point |
route |
Type of route. Accepted values are |
date |
Default = current date. Date for which route is requested. |
time |
Default = current time. Time for which route is requested. |
mode |
Required if |
max_dist |
Optional if |
route_geom |
Default = FALSE. Whether to return decoded route_geometry. Please ensure packages |
If no error occurs, a tibble of 1 x 2 with the variables:
The total time taken for this route
The total distance travelled for this route
If an error occurs, the output will be NA
, along with a warning message.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.