Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

revgeocode

Reverse geocode


Description

Reverse geocodes (looks up the address of) a longitude/latitude location using the Google Geocoding API. Note: To use Google's Geocoding API, you must first enable the API in the Google Cloud Platform Console. See ?register_google.

Usage

revgeocode(location, output = c("address", "all"), force = FALSE,
  urlonly = FALSE, override_limit = FALSE, ext = "com",
  inject = "", ...)

Arguments

location

a location in longitude/latitude format

output

"address" or "all"

force

force online query, even if cached (previously downloaded)

urlonly

return only the url?

override_limit

override the current query rate

ext

domain extension (e.g. "com", "co.nz")

inject

character string to add to the url

...

...

Value

a character(1) address or a list (the parsed json output from Google)

Author(s)

See Also

Examples

## Not run:  requires Google API key, see ?register_google

## basic usage
########################################

( gc <- as.numeric(geocode("the white house")) )
revgeocode(gc)
str(revgeocode(gc, output = "all"), 3)


## End(Not run)

ggmap

Spatial Visualization with ggplot2

v3.0.0
GPL-2
Authors
David Kahle [aut, cre] (<https://orcid.org/0000-0002-9999-1558>), Hadley Wickham [aut] (<https://orcid.org/0000-0003-4757-117X>), Scott Jackson [aut], Mikko Korpela [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.