Running
GPS, distance, time per kilometre and elevation
Which GPS points are kept or rejected, how distance is measured on the Earth's sphere, how each kilometre is timed and how elevation gain filters out altitude noise.
3 min read Updated October 9, 2026
The principle
A phone receives a position every second or so, with variable accuracy: under trees or between buildings, a point can jump by several tens of metres. Adding up every point would inflate the distance. Azetta discards doubtful points, measures the distance between the points it keeps, then derives your time per kilometre and your elevation gain.
The Azetta method
During the run
- Accuracy requested: the best available, at least one point every 5 m of movement.
- A point reported with an accuracy worse than 30 m is ignored.
- A step between two points is only added if it is less than 100 m.
- Each full kilometre triggers a vibration and records your time for that kilometre.
- Current pace is calculated over the last 30 seconds, from 20 m covered.
Distance
Between two points, the app measures the distance on the Earth treated as a sphere with a mean radius of 6,371,008.8 m, using the haversine formula:
φ is latitude, λ longitude. One degree of latitude is thus about 111,195 m.
Recording and kilometre splits
- The track is thinned to one point every 5 s (plus the last one), with coordinates rounded to a millionth of a degree (about 0.1 m).
- A segment covered at more than 12 m/s (43 km/h) is a GPS jump: its time counts, not its distance.
- The crossing of each kilometre is interpolated between the two points on either side of it; the last incomplete kilometre is not counted. Your fastest kilometre is the smallest of these times.
- The pace chart splits the run into sections of total length ÷ 40, between 100 and 1000 m.
Elevation gain
GPS altitude varies by a few metres from one point to the next without you climbing. The app therefore only counts a climb with a 3 m threshold (hysteresis): it follows the lowest point, only starts counting 3 m above it, then counts every metre gained until a descent of at least 3 m. When hiking, the filter is stronger (see the article on hiking).
Why this choice
- The haversine formula is accurate to the metre over running distances and simple to calculate on a phone.
- Rejecting inaccurate points and impossible jumps removes most of the errors that lengthen a track.
- A threshold on altitude is the simplest way not to count noise as elevation gain.
Limits
- GPS remains imperfect in dense cities, under thick cover and in tunnels: the distance may be a little short or a little long.
- There is no smoothing of positions (such as a Kalman filter) and no barometer: only rejections and a threshold.
- No grade-adjusted pace, no cadence.
- Heart rate is not recorded during a GPS run in the app; it is for activities imported from a watch.
References
- Sinnott RW. Virtues of the Haversine. Sky and Telescope, 1984;68(2):159.
- Douglas DH, Peucker TK. Algorithms for the reduction of the number of points required to represent a digitized line or its caricature. Cartographica, 1973;10(2):112-122.