get_route: Get route from Google Directions API

Description Usage Arguments Details Value Examples

View source: R/google.R

Description

Coordinates of a route from two locations from the Google Directions API.

Usage

1
get_route(from, to, api_key = maps_api_key(), ...)

Arguments

from

Character string for start of route: "The address, textual latitude/longitude value, or place ID from which you wish to calculate directions".

to

Character string for end of route

api_key

Character string of your API key. By default, looks for GOOGLE_API_KEY environment variable, see maps_api_key().

...

Other parameters passed to the Directions API

Details

The coordinates match instructions in the route and they will not be equispaced along the route.

Value

tibble with lat, lon and order columns for each step in the route.

Examples

1
2
3
4
5
## Not run: 
get_route("Corvallis, OR", "Portland, OR")
get_route("37.2341762,-112.8726299", "37.2174425,-112.973322")

## End(Not run)

cwickham/routes documentation built on Nov. 4, 2019, 9:34 a.m.