route_google {stplanr} | R Documentation |
Find shortest path using Google services
Description
Find the shortest path using Google's services.
See the mapsapi
package for details.
Usage
route_google(from, to, mode = "walking", key = Sys.getenv("GOOGLE"), ...)
Arguments
from |
An object representing origins
(if lines are provided as the first argument, from is assigned to |
to |
An object representing destinations |
mode |
Mode of transport, walking (default), bicycling, transit, or driving |
key |
Google key. By default it is |
... |
Arguments passed to the routing function |
Examples
## Not run:
from <- "university of leeds"
to <- "pedallers arms leeds"
r <- route(from, to, route_fun = cyclestreets::journey)
plot(r)
# r_google <- route(from, to, route_fun = mapsapi::mp_directions) # fails
r_google1 <- route_google(from, to)
plot(r_google1)
r_google <- route(from, to, route_fun = route_google)
## End(Not run)
[Package stplanr version 1.2.1 Index]