synthesize_baidumap_api: Synthesize baidumap 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_baidu_api_geocode() or synthesize_baidu_api_revgeocode() or synthesize_baidu_api_convcoord.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
synthesize_baidumap_api(url_body, api = c("geocode", "revgeocode",
  "convcoord"), use_curl = FALSE, ...)

synthesize_baidu_api_geocode(url_body, ics = c("BD-09", "GCJ-02",
  "WGS-84"), ocs = c("BD-09", "GCJ-02", "WGS-84"), city = NULL,
  use_curl = FALSE, ...)

synthesize_baidu_api_revgeocode(url_body, ics = c("BD-09", "GCJ-02",
  "WGS-84"), ocs = c("BD-09", "GCJ-02", "WGS-84"), pois = NULL,
  radius = NULL, extensions_road = FALSE, extensions_town = FALSE,
  language = NULL, language_auto = NULL, latest_admin = 0,
  use_curl = FALSE, ...)

synthesize_baidu_api_convcoord(url_body, coord_from = c("BD-09",
  "GCJ-02", "WGS-84"), coord_to = c("BD-09", "GCJ-02", "WGS-84"),
  use_curl = FALSE, ...)

Arguments

url_body

character, the leading argument in the API URL.

api

character, 'geocode', 'revgeocode', 'convcoord'.

use_curl

logical, whether use curl(). Default TRUE.

...

other arguments to pass to the function, e.g., key

ics

character, for geocoding. 'BD-09', 'GCJ-02' or 'WGS-84'.

ocs

character, for geocoding. 'BD-09', 'GCJ-02' or 'WGS-84'

city

character, for geocoding. A valid Chinese city name to limit the search range.

pois

numeric 1 or 0, for revgeocode. whether callback surrounding pois (1=Yes, 0=No). You will need to apply for special service access when calling pois outside China. Default NULL (0).

radius

numeric 0-1000, for revgeocode. The radius (m) for calling back pois. Default NULL (indicating 1000).

extensions_road

logical, for revgeocode. Callback 3 streets near the spot when set to TRUE. Default FALSE.

extensions_town

logical, for revgeocode. Callback info of town when set to TRUE. Default FALSE.

language

character, for revgeocode. Valid language: "local" or "el", "gu", "en", "vi", "ca", "it", "iw", "sv", "eu", "ar", "cs", "gl", "id", "es", "ru", "sr", "nl", "pt", "tr", "tl", "lv", "lt", "th", "ro", "fil", "ta", "fr", "bg", "hr", "bn", "de", "hu", "fa", "hi", "fi", "da","ja", "te", "ml", "ko", "kn", "sk", "pl", "uk", "sl", "mr", "local", "en-GB", "en-AU", "zh-TW", "pt-BR", "pt-PT", "zh-CN". Default NULL.

language_auto

numeric 1 or 0, for revgeocode. whether auto fill the admin area (1=Yes, 0=No). You will need to apply for special service access when using multi-language functionality. Default NULL (ignored).

latest_admin

numeric 1 or 0, for revgeocode. whether get the latest administrative area info (1=Yes, 0=No). Default 0.

coord_from

character, for conv coord. 'BD-09', 'GCJ-02', or 'WGS-84'

coord_to

character, for conv coord. 'BD-09', 'GCJ-02', or 'WGS-84'

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

Baidu map API documentation: http://lbsyun.baidu.com/index.php?title=webapi/guide

Examples

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

## End(Not run)

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