getCoord: Get coordinate from location

getCoordR Documentation

Get coordinate from location

Description

Get coordinate from location

Usage

getCoord(
  address,
  key = NULL,
  city = NULL,
  sig = NULL,
  output = "data.table",
  callback = NULL,
  keep_bad_request = TRUE,
  ...
)

Arguments

address

Required.
Structured address information.
Rules: Country/Region, Province/State, City, County/District, Town, Country, Road, Number, Room, Building.

key

Optional.
Amap Key.
Applied from 'AutoNavi' Map API official websitehttps://lbs.amap.com/dev/

city

Optional.
Specify the City.
Support: city in Chinese, full pinyin, citycode, adcodehttps://lbs.amap.com/api/webservice/download.
The default value is NULL which will search country-wide. The default value is NULL

sig

Optional.
Digital Signature.
How to use this argument? Please check herehttps://lbs.amap.com/faq/account/key/72

output

Optional.
Output Data Structure.
Support JSON, XML and data.table. The default value is data.table.

callback

Optional.
Callback Function.
The value of callback is the customized function. Only available with JSON output. If you don't understand, it means you don't need it, just like me.

keep_bad_request

Optional.
Keep Bad Request to avoid breaking a workflow, especially meaningful in a batch request

...

Optional.
For compatibility only

Value

Returns a JSON, XML or data.table of results containing detailed geocode information. See https://lbs.amap.com/api/webservice/guide/api/georegeo for more information.

See Also

extractCoord

Examples

## Not run: 
library(amapGeocode)

# Before the `getCoord()` is executed,
# the token should be set by `option(amap_key = 'key')`
# or set by key argument in `getCoord()`

# Get geocode as a data.table
getCoord("IFS Chengdu")
# Get geocode as a XML
getCoord("IFS Chengdu", output = "XML")

## End(Not run)


womeimingzi11/amapGeocode documentation built on Nov. 5, 2023, 6:24 a.m.