synthesize_gaodemap_api: Synthesize gaode map 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_gaode_api_geocode() or synthesize_gaode_api_revgeocode() or synthesize_gaode_api_convcoord().

Usage

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

synthesize_gaode_api_geocode(url_body, batch = FALSE, city = NULL,
  use_curl = FALSE, ...)

synthesize_gaode_api_revgeocode(url_body, batch = FALSE,
  extensions = c("all", "base"), poitype = NULL, radius = NULL,
  roadlevel = NULL, homeorcorp = NULL, use_curl = FALSE, ...)

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

Arguments

url_body

character, the leading argument in the API URL. If you want to use batch mode, you can synthesize them with pipe "|" (no more than 10 per batch). E.g., "beijing|tianjin|shanghai".

api

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

use_curl

logical, whether use curl(). Default TRUE.

...

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

batch

logical, for geocoding, If use batch inquery mode. Default FALSE.

city

character, for geocoding. A valid Chinese city name to limit results.

extensions

character, 'all' or 'base', for revgeocode. Return basic info ('base') or base+additional info ('all'). Default "all".

poitype

character, for revgeocode. One or more POI type codes (separated by a pipe '|'). The valid POI type codes refers to https://lbs.amap.com/api/webservice/download. It will not take effect when applying batch mode (multiple latlngs are provided). Only effective when extensions=="all". Default NULL.

radius

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

roadlevel

numeric 0 or 1, for revgeocode. Return all the roads (0) or main roads only (1)

homeorcorp

numeric 0-2, for revgeocode. Order the callback pois,

  • 0: do not intervene the order of the pois.

  • 1: home-related pois are prioritized.

  • 2: coorporate-related pois are prioritized.

Default NULL (0).

coord_from

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

coord_to

character, for conv coord. 'BD-09', 'GCJ-02', or 'WGS-84'. Only 'GCJ-02' is now supported.

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

Gaode map API documentation: https://lbs.amap.com/api/webservice/guide/api

Examples

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

## End(Not run)

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