wgs2gcj: Convert coordinates

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/cst.R

Description

converts lat/lon coordintes from WGS-84 to GCJ-02

Usage

1
wgs2gcj(wgsLat, wgsLon)

Arguments

wgsLat

a numeric latitude in WGS-84

wgsLon

a numeric longitude in WGS-84

Details

All real WGS-84 latitude/longitude coordites must be encrypted by National Admistration of Surveying, Mapping and Geoinformation (http://en.sbsm.gov.cn/) into GCJ-02 (known as 'Mars coordinate system') with a deviation no more than 700 meters in China. The decryption algorithm is a public secrect on the Internet and verfied to be correct.

Value

a data.frame with variables lat/lng

Author(s)

Jun Cai ([email protected]), PhD candidate from Department of Earth System Science, Tsinghua University

See Also

gcj2wgs, conv.

https://on4wp7.codeplex.com/SourceControl/changeset/view/21483#353936 for C version source code.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
# latitude/longitude coordinates of Beijing railway station
# WGS-84: (39.90105, 116.42079)
# GCJ-02: (39.90245, 116.42703)
wgs2gcj(39.90105, 116.42079) # correct
# convert multiple coordinates
wgs2gcj(c(39.99837, 39.98565), c(116.3203, 116.2998))

## End(Not run)

caijun/geoChina documentation built on May 11, 2017, 9:52 p.m.