Route two locations: determine a sequence of steps (legs) between two
locations using the Google Directions API. Note: To use Google's Directions
API, you must first enable the API in the Google Cloud Platform Console. See
register_google()
.
route(
from,
to,
mode = c("driving", "walking", "bicycling", "transit"),
structure = c("legs", "route"),
output = c("simple", "all"),
alternatives = FALSE,
units = "metric",
urlonly = FALSE,
override_limit = FALSE,
ext = "com",
inject = "",
...
)routeQueryCheck()
a data frame (output="simple") or all of the geocoded information (output="all")
vector of origin addresses
vector of destination addresses
driving, bicycling, walking, or transit
structure of output, "legs" or "route", see examples
amount of output ("simple" or "all")
should more than one route be provided?
"metric"
return only the url?
override the current query count
domain extension (e.g. "com", "co.nz")
character string to add to the url
...
David Kahle david@kahle.io
https://developers.google.com/maps/documentation/directions/,
trek()
, legs2route()
, geom_leg()
, register_google()