googleway (version 2.7.1)

google_reverse_geocode: Google reverse geocoding

Description

Reverse geocoding is the process of converting geographic coordinates into a human-readable address.

Usage

google_reverse_geocode(location, result_type = NULL, location_type = NULL,
  language = NULL, key = get_api_key("reverse_geocode"), simplify = TRUE,
  curl_proxy = NULL)

Arguments

location

numeric vector of lat/lon coordinates.

result_type

string vector - one or more address types. See https://developers.google.com/maps/documentation/geocoding/intro#Types for list of available types.

location_type

string vector specifying a location type will restrict the results to this type. If multiple types are specified, the API will return all addresses that match any of the types

language

string specifies the language in which to return the results. See the list of supported languages: https://developers.google.com/maps/faq#using-google-maps-apis. If no langauge is supplied, the service will attempt to use the language of the domain from which the request was sent

key

string. A valid Google Developers Geocode API key

simplify

logical - TRUE indicates the returned JSON will be coerced into a list. FALSE indicates the returend JSON will be returned as a string

curl_proxy

a curl proxy object

Value

Either list or JSON string of the geocoded address

API use and limits

The amount of queries you can make to Google's APIs is dependent on both the service and the API you are using.

Each API has specific quotas and limits. Check Google's API documentation for details.

View your usage at the Google Cloud Console https://console.cloud.google.com/

Each API can only accept and return one request at a time. If you write a loop to make multiple API calls you should ensure you don't go over your quota / limits during the loop.

Examples

Run this code
# NOT RUN {
## searching for the street address for the rooftop location type
google_reverse_geocode(location = c(-37.81659, 144.9841),
                       result_type = c("street_address"),
                       location_type = "rooftop",
                       key = "<your valid api key>")
# }

Run the code above in your browser using DataLab