synthesize_googlemap_api: Synthesize googlemap API

Description Usage Arguments Value Note References Examples

View source: R/api.R

Description

Working function for synthesize_api(). It will call lower functions synthesize_google_api_geocode() or synthesize_google_api_revgeocode().

Usage

1
2
3
4
5
6
7
8
synthesize_googlemap_api(url_body, api = c("geocode", "revgeocode"),
  use_curl = TRUE, ...)

synthesize_google_api_geocode(url_body, region = NULL,
  components = NULL, use_curl = TRUE, ...)

synthesize_google_api_revgeocode(url_body, result_type = NULL,
  location_type = NULL, use_curl = TRUE, ...)

Arguments

url_body

character, the leading argument in the API URL.

api

character, 'geocode' or 'revgeocode'.

use_curl

logical, whether use curl(). Default TRUE.

...

other arguments to pass to the function, e.g., language, client, signature, key

region

character, for geocoding. The region code, specified as a ccTLD ("top-level domain") two-character value. This parameter will only influence, not fully restrict, results from the geocoder.

components

character, for geocoding. A components filter with elements separated by a pipe (|). The components filter is required if the request doesn't include an address. Each element in the components filter consists of a component:value pair, and fully restricts the results from the geocoder.

result_type

character, for regeocoding. A filter of one or more address types, separated by a pipe (|). If the parameter contains multiple address types, the API returns all addresses that match any of the types. A note about processing: The result_type parameter does not restrict the search to the specified address type(s). Rather, the result_type acts as a post-search filter: the API fetches all results for the specified latlng, then discards those results that do not match the specified address type(s). Note: This parameter is available only for requests that include an API key or a client ID. The following values are supported:
'street_address', 'route', 'intersection', 'political', 'country', 'administrative_area_level_1', 'administrative_area_level_2', 'administrative_area_level_3', 'administrative_area_level_4', 'administrative_area_level_5', 'colloquial_area', 'locality', 'sublocality', 'neighborhood', 'premise', 'subpremise', 'postal_code', 'natural_feature', 'airport', 'park', 'point_of_interest.'

location_type

character, for revgeocoding. A filter of one or more location types, separated by a pipe (|). If the parameter contains multiple location types, the API returns all addresses that match any of the types. A note about processing: The location_type parameter does not restrict the search to the specified location type(s). Rather, the location_type acts as a post-search filter: the API fetches all results for the specified latlng, then discards those results that do not match the specified location type(s). Note: This parameter is available only for requests that include an API key or a client ID. The following values are supported:
'ROOFTOP', 'RANGE_INTERPOLATED', 'GEOMETRIC_CENTER', 'APPROXIMATE.'

Value

A url object for get_api_data() use.

Note

When key is omitted or set NULL, the function will search for it in the cache. If nothing is found, a GUI wizard will be launched for you to input the API key. If you want to bypass API key, set key = NA.

References

Googlemaps API documentation: https://developers.google.com/maps/documentation

Examples

1
2
3
4
## Not run: 
synthesize_googlemap_api("<Address>", key="<YOUR GOOGLEMAP KEY>")

## End(Not run)

madlogos/asesgeo documentation built on Aug. 9, 2019, 9:53 a.m.