Sequence treks (latitude-longitude sequences following ordinary paths, e.g.
roads) 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()
.
trek(
from,
to,
mode = c("driving", "walking", "bicycling", "transit"),
output = c("simple", "all"),
alternatives = FALSE,
units = "metric",
urlonly = FALSE,
override_limit = FALSE,
ext = "com",
inject = "",
...
)
a tibble
name of origin addresses in a data frame
name of destination addresses in a data frame
driving, bicycling, walking, or transit
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 with the key decoding algorithm due to Stack Overflow user akhmed
https://developers.google.com/maps/documentation/directions/,
https://stackoverflow.com/questions/30270011/ggmap-route-finding-doesnt-stay-on-roads/,
route()
, routeQueryCheck()
, register_google()