My Google Map Blog

Tag: map projections

A further look at Chinese map offsets

by Timothy Whitehead on Aug.18, 2015, under 3D Models, Argentina, Australia, Brazil, California, Denmark, England, Germany, Google Earth News, Google Earth Tips, Google Sky, Google maps, Hawaii, Indonesia, Ireland, Italy, Japan, Kenya, Mexico, Natural Landmarks, Netherlands, Sightseeing, Street Views, USA

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.

The post A further look at Chinese map offsets appeared first on Google Earth Blog.

Comments Off :, , more...

Chinese street maps out of alignment in Google Earth and Google Maps

by Timothy Whitehead on Aug.17, 2015, under 3D Models, Argentina, Australia, Brazil, California, Denmark, England, Germany, Google Earth News, Google Earth Tips, Google Sky, Google maps, Hawaii, Indonesia, Ireland, Italy, Japan, Kenya, Mexico, Natural Landmarks, Netherlands, Sightseeing, Street Views, USA

While investigating the recent explosions in Tianjin, China, we noticed that the street map of China is out of alignment in both Google Earth and Google Maps. It is tempting to think that the explosions were so large that they shook the street map out of place (the largest, according to Wikipedia, has been estimated as equivalent to 21 tonnes of TNT). However, after a bit of research we have discovered that the street map offset is not new and is actually a result of old Chinese regulations from the cold war era.

It turns out that all maps that are legally created in China must use the GCJ-02 coordinate system, which according to Wikipedia, uses an encryption algorithm that offsets the map by different amounts for different locations. Google has followed the regulations and partnered with Chinese map provider AutoNavi to obtain the data and always shows the map data using the required GCJ-02 datum.

As we have mentioned in previous posts on censorship, countries can control and censor mapping information such as aerial imagery, 3D imagery and street maps that is gathered within their borders, but have little control over satellite imagery unless the company that supplies it operates from within their borders. As a result, both Google Earth and Google Maps do not show the satellite data using the offset GCJ-02 datum but stick with the standard WGS-84 datum used for the rest of the world. This results in the discrepancy we see between the street map and the satellite imagery. However, the Chinese version of Google Maps intended to be viewed from within China does comply with Chinese laws and uses the GCJ-02 datum for the satellite imagery as well. As a result, the street maps and satellite imagery line up nicely, but GPS coordinates will be offset. This is dealt with by Chinese navigation systems, which must convert between the datums to give the correct location on the map.


The China / Hong Kong border in Google Earth. The streets are out of alignment on the Chinese side, but correct on the Hong Kong side. The satellite imagery matches the latitude and longitude as produced by a standard GPS.


In the Chinese version of Google Maps, the situation is reversed. The streets are aligned with satellite imagery in China, but misaligned in Hong Kong. Both satellite imagery and street maps on the Chinese side do not match latitude and longitude as produced by a standard GPS.

Apparently Bing Maps and Apple Maps also follow Chinese regulations and use the GCJ-02 datum, whereas Open Street Map does not (and is thus illegal in China).

We also mentioned China’s strict mapping regulations back in 2006.

The post Chinese street maps out of alignment in Google Earth and Google Maps appeared first on Google Earth Blog.

Comments Off :, , , more...

Converting a Google Maps screenshot to Google Earth

by Timothy Whitehead on Aug.12, 2015, under 3D Models, Argentina, Australia, Brazil, California, Denmark, England, Germany, Google Earth News, Google Earth Tips, Google Sky, Google maps, Hawaii, Indonesia, Ireland, Italy, Japan, Kenya, Mexico, Natural Landmarks, Netherlands, Sightseeing, Street Views, USA

Yesterday we looked at a problem with the Street View layer of Google Earth. We thought it would be interesting to compare the Street View coverage as shown in Google Earth with that shown in Google Maps. However, it is not very easy to compare them side by side due to the different formats.

So, we decided to finally try out something we have long considered doing but not got around to: get a screenshot of a Google Map into Google Earth. We started by capturing a screenshot of the current coverage of Street View in Google Maps at a resolution of 4096×4096 pixels using this file that uses the Google Maps API. Next, we took a screenshot using this screen capture plugin for Chrome.

Google Maps uses the Web Mercator Projection, but Google Earth overlays need to be in the Equirectangular Projection as we mentioned in this post. We found an open source library called GDAL that can convert between different map projections and using suggestions from this page on GIS StackExchange we were able to get our screen shot into the correct projection. We had to use the free image editing program GIMP to convert our initial screen shot to a tiff image, but apart from that there were no difficulties.

All that was left was to create a global overlay from the image and this is the result:

To try it out for yourself, download this KML file.

Also try adjusting the transparency of the image overlay as seen below:

The post Converting a Google Maps screenshot to Google Earth appeared first on Google Earth Blog.

Comments Off :, , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...