How Google Earth measures distances

In yesterday’s post we mentioned that Google Earth’s measurements did not match ours, which used the Haversine formula. So we decided to investigate a bit more.

The Haversine formula assumes the earth is a perfect sphere and in our case we assumed the radius to be 6,378,137m. The earth is actually closer to an oblate spheroid (a flattened sphere), with the equator bulging slightly relative to the poles. According to Wikipedia Google Earth uses the WGS84 datum as used by GPS, which uses an oblate spheroid that approximates the real shape of the earth. There is a formula known as Vincenty’s formula that can be used to calculate distances for the WGS84 datum. We found some JavaScript code to do this here. We have incorporated it into yesterday’s post, so you now have the option to use either the Haversine formula or Vincenty’s formula.

So, we used our updated code and again compared it with Google Earth’s measurements, and it still doesn’t quite match. Further investigation was needed. We discovered that Google Earth takes altitude into account when displaying the length of a path. When you draw a polygon in Google Earth, it is by default given an absolute altitude of 0. It is also set as ‘clamped to ground’ which means it is drawn on top of the ground surface or at sea level when over the oceans, but we found that whatever the local ground height, it gave the same distance measurements as an absolute altitude of 0. If you give the path an absolute altitude, you can raise or lower the path, and its measurement will change, getting longer as it gets higher. We discovered that to get a match between the results of Vincenty’s formula and Google Earth’s measurements, we had to set the path to an altitude of 80m. This worked at various latitudes. So does Google Earth have a slightly different sea level from the one used for WGS84 or are we missing something? We would love to hear from any of our readers with more expertise in this area.

If you wish to do some testing for yourself, you can download this test KML file, which has three lines at different latitudes, each of which covers exactly one degree of latitude.

For the above lines we got the following measurements in centimetres:

Google Earth at Altitude 0 Vincenty Haversine
11,057,299 11,057,439 11,131,950
11,085,952 11,086,093 11,131,950
11,141,932 11,142,073 11,131,950

As you can see, the discrepancies we are talking about are only on the 6th significant digit.

See here to learn various ways to measure in Google Earth, and here for some of the extra measurement features found in Google Earth Pro.

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. In Google earth maps the names of village Kil Villivalam (south India) is given to the location where the village Srirangarajapuram is there . I could correct the name but the wrongly mentioned name could not be erased.( Iam from that area and can give correct locations of various villages there. )- ise. just tell me how to erase the unwanted name .

  2. It would make a difference to the overall distance if Google took account of terrain, right? Travelling over a mountain would be a longer route than tunnelling through it.



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.