A further look at Chinese map offsets

Yesterday we talked about how the Street Maps of China are offset from the satellite imagery because of their laws requiring the use of the GCJ-02 datum. The GCJ-02 datum moves the map by different amounts in different places. You can typically work out correct coordinates by a simple addition or subtraction to latitude and longitude for a given area, but the amount to be added or subtracted varies across the country. So for a given city in China a particular set of offsets unique to that city would suffice for most purposes, but for countrywide mapping it is a lot more complicated.

We thought it would be interesting to get an overall view of how much the map is offset and in which direction. We found some Java code here to convert from WGS-84 to GCJ-02 and converted it to JavaScript for use in this post. We later found another version on Github that includes JavaScript code.

The first thing we did was to create this KML file that shows the relative magnitudes and directions of the offsets.


The smallest offsets are near Haixi (just left of centre), and the largest offsets are in the northeast of China.

Note that the magnitudes displayed above are relative. Actual magnitudes vary from a few metres to a few hundred metres and would not be visible at that scale.

Our next step was to create a converter to use with Google Earth. If you have a GPS track that uses the standard WGS-84 coordinates and you want it to match the Google Earth street map, then it might be useful. Just save it as a KML and use the converter below. It should work on most KML features, but ignores the camera position, but that shouldn’t matter for most applications. We make no guarantees regarding accuracy. The conversion is done in JavaScript and the file is never uploaded to our servers.

WGS-84 to GCJ-02 KML converter:

Convert to GCJ-02

We have also discovered that Baidu Maps uses yet another coordinate system called BD-09 that is based on GCJ-02 but adds further encryption. Baidu provides a converter to BD-09 as part of their API.

About Timothy Whitehead

Timothy has been using Google Earth since 2004 when it was still called Keyhole before it was renamed Google Earth in 2005 and has been a huge fan ever since. He is a programmer working for Red Wing Aerobatx and lives in Cape Town, South Africa.






PLEASE NOTE: Google Earth Blog is no longer writing regular posts. As a result, we are not accepting new comments or questions about Google Earth. If you have a question, use the official Google Earth and Maps Forums or the Google Earth Community Forums.

Comments

  1. nice, interesting!

  2. Vladimir Cvajniga says:

    Is it possible to set offset to historical imagery in my Google Earth Pro? All sets of the imagery are shifted in some direction (up to several metres). I’d like to stick same geografical position to the same coordinates.
    Sorry for my poor English.

  3. Terje M. Tollefsen says:

    Hi Timothy; when I use your converter above, the file kml file I reimport to GE is shifted the wrong way. It should be shifted north, but is shifted south. Anyone else have had this issue? Am I doing something wrong?



PLEASE NOTE: Google Earth Blog is no longer writing regular posts. As a result, we are not accepting new comments or questions about Google Earth. If you have a question, use the official Google Earth and Maps Forums or the Google Earth Community Forums.