People Rectify Coordinates

With restrictions from the People’s Republic of China

Input

    • ;
    • .
    • ° ;
    • ° .

Results

Operation Result ΔObfs/m ΔRoundtrip/m
WGS → GCJ
WGS → BD
GCJ →cai WGS
BD →cai WGS
GCJ → BD
BD →cai GCJ

. Toggle sections: Notes, FAQ, footer.

Map

天地图 WGS-84

高德地图 GCJ-02

百度地图 BD-09

腾讯地图 GCJ-02

Notes

  1. Caijun’s iterative method is included for precise decoding. It's most useful for bored folks whose GPS data is pretty accurate and GCJ-02 obfuscation not tainted by the original LCPRNG.

    If you are doing Wikipedia or any kind of archival work, use it to avoid introducing extra error.

  2. BD is defined in terms of GCJ, hence the last three functions.
  3. This demo omits the “in China” sanity check. Data regarding Baidu’s behavior with overseas maps is needed for further decisions. Observations:
    • Unlike Google Maps, Baidu's map in Hong Kong is fully subject to BD-09 ∘ GCJ-02 chained distortions.
    • Coordinates in Russia, outside of the sanity check rectangle, uses WGS-84 or and/or friends.
    • TODO: check along the boundary.

FAQ

What is this all about?
The PRC government requires all local map services to use an obfuscated, deviation-orienated coordinate system. Click on the “restriction” link to read the full Wikipedia article.
Why should I care?
With half a kilometer of deviation, GCJ-02 and friends fucks up your Ingress games, causes crazy errors in elevation profiles along cycle routes, and cheerfully leads you into roadside ditches plus a bone fracture.
Why doesn’t Google/Bing correct its Chinese data served to global users?
I don’t know. Perhaps they are afraid of getting fined or further kicked out of China. Maybe try OpenStreetMap next time?
Why are you writing another implementation?
Because I got bored.
How does Caijun’s iterative method work?
Cai has explained the method in full in his R implementation. Go read it, or read Wikipedia.