parse_revgeocodes: Parse revgeocode API results

Description Usage Arguments Value Author(s) See Also Examples

View source: R/revgeocode.R

Description

This is a wrapper of API result parsers for google, baidu and gaode map. It can serve as a subsequent handler to convert 'raw' results yielded using revgeocode() to a structured data.frame.

Usage

1
2
parse_revgeocodes(rgclst, output = c("address", "addressc", "all"),
  gcs = NULL, idf = TRUE, ...)

Arguments

rgclst

a list comprising of lists of class 'google_revgeocode', 'baidu_revgeocode' or 'gaode_revgeocode', subclasses of 'api_data'.

output

character, 'address', 'addressc', or 'all'. Default 'address'. Refer to revgeocode().

gcs

character, the geo-coordinate system for output. 'WGS-84', 'GCJ-02', or 'BD-09'. Default NULL, which indicates that no coordinate conversion will be conducted on the results.

idf

logical, whether generate an identifier column 'idf' in the output. Default TRUE.

...

optional arguments. Generic args:

  • ics_china: default coordinate system for locations in China, 'WGS-84', 'GCJ-02', or 'BD-09'

  • ics_intl: default coordinate system for locations outside China, 'WGS-84', 'GCJ-02', or 'BD-09'

API-specific args:

google api
  • name_type: character 'long' or 'short', indicating whether to extract long_name or short_name. Default 'long'.

baidu api
  • (not used yet)

gaode api
  • (not used yet)

Value

a tibble

Author(s)

Yiying Wang, wangy@aetna.com

See Also

parse_api_data(), revgeocode(), geocode(), parse_geocodes(); geohost(), parse_geohosts();

Examples

1
2
3
4
5
## Not run: 
rgc <- revgeocode(c(<lat1>, <lon1>), api='google', output='raw')
parse_revgeocodes(rgc, output='all')

## End(Not run)

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