View source: R/google_encode64.R
This function, primarily, is a helper for drive_time
and geocode_url
.
It is only necessary when building digital signatures with the private cryptographic key associated with
your (paid) Google for Work account. To build valid signatures your vector of addresses must be url
encoded (see: url_encode
and contain "web-safe" UTF-8 characters
(see: address_cleaner
). For basic geocoding and distance analyses it is generally easier to use drive_time
and geocode_url
to encode a request with your Google for Work private key. However, and particularly with large batch jobs,
it can be useful to inspect the output of this function for malformed values which yield invalid signatures (see the "sigfile" option).
The general pattern of this function follows the Google Developer documention
for generating a digital signature witgh Python.
1 2 3 |
address |
A 1xN vector of UTF-8 url encoded addresses (if gmode='dtime', this is the origin address). |
dest |
If gmode is 'dtime', this is the destination address. |
gmode |
character string; must be either "geocode" (the default) or "dtime" (for distance requests). |
privkey |
character string; your Google for Work API key |
clientid |
character string; generally, this ID will be of the form 'gme-[company]'. |
debug |
logical; when TRUE, returns a complete data frame of locations and their associated URL signatures (this can be useful for debugging invalid signatures). |
verbose |
logical; when TRUE, displays additional progress output. |
travel_mode |
character string; currently, valid values include (see this page for details):
|
units |
character string; must be either "metric" (the default) or "imperial". Specifying "metric" will return distance between origin and destination as kilometers, whereas "imperial" returns distance in miles. For geocode requests this parameter is ignorned if non-null. |
language |
character string; localization of the returned object. This set to "en-EN" by default, but refer to this page for an up-to-date list of all supported languages. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.