eviltransform is a compact library for converting geographic coordinates between the global WGS-84 system (used by GPS) and the Chinese GCJ-02 system (used by many Chinese map services such as Google Maps China and AutoNavi). The project implements forward and inverse transformations (WGS→GCJ and GCJ→WGS) as well as a higher-precision inverse method (GCJ→WGS exact) that trades speed for sub-meter accuracy, and it includes a utility for computing geodesic distance in meters. It’s implemented (or ported) across many languages and platforms — you’ll find reference implementations in Go, C/C++/Obj-C, Java, JavaScript, Python, PHP, C#, Haskell, Rust, Swift, MATLAB and more — which makes it easy to drop into server, client, or mobile codebases. The README documents the API signatures and describes expected numeric accuracy (e.g., ~1–2 m for the standard inverse, <0.5 m for the exact inverse) and when to use each routine.
Features
- Conversion from GCJ-02 → WGS-84
- Conversion from WGS-84 → GCJ-02
- “Exact” inverse conversion for higher precision
- Distance calculation between two geographic points
- Lightweight implementation with minimal dependencies
- Error handling / fallback for out-of-bound coordinates