get_img: Get Street View image from Google Street View API

Description Usage Arguments Details Value Examples

View source: R/google.R

Description

Download Street View image at given latitude, longitude location.

Usage

1
2
get_img(lat, lon, dir, api_key = maps_api_key(), size = "100x100",
  suffix = "", ...)

Arguments

lat

latitude

lon

longitude

dir

path to directory image should be downloaded to

api_key

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

size

dimensions in pixels of file to download as a string, e.g. "100x100"

suffix

string to be appended to the end of the file name

...

other parameters passed along to the Google Street View Static API, e.g. heading, pitch.

Details

See the Google Street View Static API Docs for more info on available parameters.

Value

file path of downloaded file, invisibly.

Examples

1
2
3
4
5
## Not run: 
img <- get_img(lat = 37.2341762, lon = -112.8726299, dir = tempdir())
display_jpeg(img)

## End(Not run)

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