| Crates.io | undrift_gps |
| lib.rs | undrift_gps |
| version | 0.3.1 |
| created_at | 2018-05-26 14:12:52.757833+00 |
| updated_at | 2021-02-24 04:02:03.370807+00 |
| description | Convert between various coordinate systems: GCJ-02, WGS-84 and BD-09 |
| homepage | |
| repository | https://github.com/hghwng/undrift_gps |
| max_upload_size | |
| id | 67133 |
| size | 15,021 |
Traversal between the Earth and the Mars in just 6 functions! Keep it simple and stupid.
Kudos to Zili FENG!
/// Convert a GCJ-02 coordinate into WGS-84
pub fn gcj_to_wgs(lat: f64, lon: f64) -> (f64, f64)
/// Convert a GCJ-02 coordinate into BD-09
pub fn gcj_to_bd(lat: f64, lon: f64) -> (f64, f64)
/// Convert a WGS-84 coordinate into GCJ-02
pub fn wgs_to_gcj(lat: f64, lon: f64) -> (f64, f64)
/// Convert a WGS-84 coordinate into BD-09
pub fn wgs_to_bd(lat: f64, lon: f64) -> (f64, f64)
/// Convert a BD-09 coordinate into GCJ-02
pub fn bd_to_gcj(lat: f64, lon: f64) -> (f64, f64)
/// Convert a BD-09 coordinate into WGS-84
pub fn bd_to_wgs(lat: f64, lon: f64) -> (f64, f64)
Add this to your Cargo.toml:
[dependencies]
undrift_gps = "0.2.1"