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|
As you can see, the discrepancies we are talking about are only on the 6th significant digit.