Learn R Programming

geoChina (version 1.3.0)

wgs2bd: Convert coordinates

Description

converts lat/lon coordintes from WGS-84 to BD-09

Usage

wgs2bd(wgsLat, wgsLon)

Arguments

wgsLat
a numeric latitude in WGS-84
wgsLon
a numeric longitude in WGS-84

Value

a data.frame with variables lat/lng

Details

convert WGS-84 coordinates first into GCJ-02, then into BD-09.

See Also

wgs2gcj, gcj2bd, conv.

Examples

Run this code
## Not run: ------------------------------------
# # latitude/longitude coordinates of Beijing railway station
# # WGS-84: (39.90105, 116.42079)
# # BD-09:  (39.90851, 116.43351)
# wgs2bd(39.90105, 116.42079) # correct
# # convert multiple coordinates
# wgs2bd(c(39.99837, 39.98565), c(116.3203, 116.2998))
## ---------------------------------------------

Run the code above in your browser using DataLab