geocode: Geocode address

Description Usage Arguments Value Examples

Description

Geocode a particular address.

Usage

1
geocode(address, api = "amap", key = NULL, output = "json")

Arguments

address

a string, address to geocode, more specific the better

api

which API to use, currently supports "Amap" or "Baidu"

key

API application key

output

specify output type, JSON or XML

Value

Geocode of address (latitude, longitude) # take note of the order

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
geocode("北京市朝阳区朝阳首府", api = "amap", key = "Your_Api_Key_Here")

# set application key via environment variables
file.edit("~/.Renviron")
# restart R to take effect
amap_ak <- Sys.getenv("amap_ak")
geocode("北京市朝阳区朝阳首府", key = amap_ak, output = "xml")

## End(Not run)

tmasjc/GeocodeCN documentation built on May 5, 2019, 2:42 a.m.