transcoord | R Documentation |
This function supports to transform the coordinates from three other coordinate systems (including baidu, GPS and mapbar) to Amap system
transcoord(data, longitude, latitude, coordsys = "autonavi", ncore = 999)
data |
The dataset, a data.frame or data.table |
longitude |
The column having longitude |
latitude |
The column having latitude |
coordsys |
The coordinate system of your original location data, such as "gps", "baidu", "mapbar" and "autonavi" (coordsys = "autonavi" by default) |
ncore |
The specific number of CPU cores used (ncore = 999 by default, which indicates the maximum of CPU cores minus 1 were used in parallel computing if your CPU is less than 999 cores) |
a data.table which adds the transformed longitude and latitude using Amap System in the original data set
The value of "longitude" or "latitude" should be digits in numeric or character format. If not, the function may return empty result for this coordinate automatically
Amap. Official documents for developers: Web Service API. https://lbs.amap.com/api/webservice/summary
## Not run: library(amapR) options(amap.key = "xxxxxxxxxxxxxxxx") # Completed data test <- data.frame(n = 1:500, lng = c(114.4345,104.0837), lat = c(30.51105, 30.63087)) results <- transcoord(data = test, longitude = "lng", latitude = "lat", coordsys = "baidu") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.