Description Usage Arguments Value Author(s) See Also Examples
Grab a route from Google. Note that in most cases by using this function you are agreeing to the Google Maps API Terms of Service at https://developers.google.com/maps/terms.
1 2 3 4 5 |
from |
name of origin addresses in a data frame (vector accepted) |
to |
name of destination addresses in a data frame (vector accepted) |
mode |
driving, bicycling, walking, or transit |
structure |
structure of output, see examples |
output |
amount of output |
alternatives |
should more than one route be provided? |
units |
"metric" |
messaging |
turn messaging on/off |
urlonly |
return only the url? |
override_limit |
override the current query count (.GoogleRouteQueryCount) |
ext |
domain extension (e.g. "com", "co.nz") |
inject |
character string to add to the url |
... |
... |
a data frame (output="simple") or all of the geocoded information (output="all")
David Kahle david.kahle@gmail.com
https://developers.google.com/maps/documentation/directions/,
trek
, legs2route
,
routeQueryCheck
, geom_leg
,
register_google
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ## Not run: # to cut down on check time
from <- "houston, texas"
to <- "waco, texas"
route_df <- route(from, to, structure = "route")
trek_df <- trek(from, to, structure = "route")
qmap("college station, texas", zoom = 8) +
geom_path(
aes(x = lon, y = lat), colour = "red",
size = 1.5, alpha = .5,
data = route_df, lineend = "round"
) +
geom_path(
aes(x = lon, y = lat), colour = "blue",
size = 1.5, alpha = .5,
data = trek_df, lineend = "round"
)
qmap("college station, texas", zoom = 6) +
geom_path(
aes(x = lon, y = lat), colour = "red", size = 1.5,
data = route_df, lineend = "round"
)
routeQueryCheck()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.