Learn R Programming

baidumap (version 0.2.2)

getCoordinate: Get coordiante from address Take in address and return the coordinate

Description

Get coordiante from address Take in address and return the coordinate

Usage

getCoordinate(address, city = NULL, output = "json", formatted = F,
  limit = 600)

Arguments

address

address

city

the city of the address, optional

output

should be "json" or "xml", the type of the result

formatted

logical value, return the coordinates or the original results

limit

integer value.If the length of address exceeded limit, function will run in parallel

Value

A vector contains the corresponding coordiante. If "formatted=TRUE", return the numeric coordinates, otherwise return json or xml type result, depents on the argument "output". If the length of address is larger than 1, the result is a matrix.

Examples

Run this code
# NOT RUN {
## json output
getCoordinate('<U+5317><U+4EAC><U+5927><U+5B66>')

## xml output
getCoordinate('<U+5317><U+4EAC><U+5927><U+5B66>', output='xml')

## formatted
getCoordinate('<U+5317><U+4EAC><U+5927><U+5B66>', formatted = T)

## vectorization, return a matrix
getCoordinate(c('<U+5317><U+4EAC><U+5927><U+5B66>', '<U+6E05><U+534E><U+5927><U+5B66>'), formatted = T)
# }

Run the code above in your browser using DataLab