Description Usage Arguments Details Source Examples
Interrogate the Google Maps API to geocode a specified location. Geocoding provides longitude, latitude and some additional data. including full address where available.
1 2 |
location |
vector of location strings. |
output |
string specifying desired output. |
region |
two letter country code to determine search bias. |
item |
numeric value specifying which result to return if there are multiple matches. |
... |
additional parameters passed to the Google API. |
The Google API attempts a fuzzy match of the specified location(s). Where the location is ambiguous, a single result will be returned and the specified search bias region will used to assist in making a selection.
Notice there is a limit of 2,500 calls per day. Currently, the function does not enforce this limit, so exercise caution!
Location type, for more info check here: https://developers.google.com/maps/documentation/directions/ "ROOFTOP" indicates that the returned result is a precise geocode for which we have location information accurate down to street address precision. "RANGE_INTERPOLATED" indicates that the returned result reflects an approximation (usually on a road) interpolated between two precise points (such as intersections). Interpolated results are generally returned when rooftop geocodes are unavailable for a street address. "GEOMETRIC_CENTER" indicates that the returned result is the geometric center of a result such as a polyline (for example, a street) or polygon (region). "APPROXIMATE" indicates that the returned result is approximate.
The code is adapted from
Jose Gonzales.
This function is very similar to the geocode
function in the ggmap
package.
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.