hmac
sha1 algorithm.
For smaller batch requests, it is also possible to access Google's "standard API"
using this function (see this page to obtain a free API key).
geocode_url(address, auth = "standard_api", privkey = NULL, clientid = NULL, clean = FALSE, verbose = FALSE, add_date = "none", messages = FALSE, dryrun = FALSE)
address_cleaner
function, which strips or replaces common characters that are incompatible with the Maps API. Notes:
TRUE
, applies address_cleaner
to the address vector prior to URL encoding.TRUE
, displays additional output in the returns from Google.TRUE
, displays warning and error messages generated by the API calls within the pull_geo_data
function (e.g. connection errors, malformed signatures, etc.)TRUE
, aborts script prior to the pull_geo_data
url call, returning the URL to be encoded. This can be useful for debugging addresses that yield non-conformant JSON returns.placement
package. For Google for Work requests, this error (usually)
indicates that the signature associated with the geocode request was invalid.
address
parameter (this is returned for matching/verification).
# Get coordinates for the Empire State Building and Google
address <- c("350 5th Ave, New York, NY 10118, USA",
"1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA")
coordset <- geocode_url(address, auth="standard_api", privkey="",
clean=TRUE, add_date='today', verbose=TRUE)
# View the returns
print(coordset[ , 1:5])
Run the code above in your browser using DataLab