Learn R Programming

walkscoreAPI (version 1.2)

geoloc: Google Geolocation API Call

Description

A function to perform the Google Geolocation API call, and return the longitude and latitude coordinates of the query location.

Usage

geoloc(address, apikey)

Arguments

address
query address (string). Do not use commas, and zip codes are not required, e.g. "1600 Pennsylvania Ave Washington DC".
apikey
your Google API key (string)

Value

GoogleGeoloc, basically a list of the following elements:
coordinates
A vector of two numbers, the first representing the longitude and the second representing the latitude.
accuracy
Accuracy rating of geolocation.
city
City containing the requested address
state
State containing the requested address
country
Country containing the requested address

Details

Use of this function requires a Google API key, which is different from the Walk Score API key. Get one here: http://code.google.com/apis/maps/signup.html

References

http://code.google.com/apis/gears/api_geolocation.html

Examples

Run this code
## Not run: 
# geoloc("350 5th Avenue New York NY","your Google API key")
# ## End(Not run)

Run the code above in your browser using DataLab