Earth is not a sphere, but an ellipsoid. This has many implications. One of them is the computation of the distance between two GPS positions. Today GPS is a prerequisite for mobile applications using maps and there are two major providers of such maps, as well as other GIS related parties. The two major providers are:
The GIS parties are numerous.
There are two ways to calculate the distance between two GPS positions:
- by using the spherical model
- by using the geodetic model
The spherical model
This is a simplified method of computation of the distance, based on the generally accepted average value of earth radius. The value is 6374 km and is considered the same for every latitude. Unfortunately, The distance is not accurate. It might be close to the real value for small distances at latitudes where the radius is indeed 6374 km. The distance can be calculated with a simple formula.
The geodetic (ellipsoid) model
The radius of the Earth changes with the latitude. It is known that the radius of the Earth an the poles is shorter by 21,9 km than the radius at the equator. Under this model, the radius of the Earth changes with the latitude. The mathematics behind it is complex. There is no generic formula for the calculation. The best way is to use an iterative numerical computation. In the past there have been some remarkable places on Earth for which the distance calculated had errors. Today, it is possible to compute the distance with a very high precision (up to meters or centimeters).
For those who want to calculate the accurate distance between two GPS positions, there is good news. The Geographic Lib project does the computation following the geodetic model.