Elevation accuracy of .gpx files
The elevation data collected by GPS devices (like phones and sports watches) and saved in .gpx
files isn’t always correct. To get a sense for typical accuracy, I compared the elevation data recorded by different devices travelling along the same path.
Devices
I grabbed every device in the house that could create a .gpx
file.
From cheapest and oldest to newest and most expensive:
- An old Garmin GPS watch.
- A cheap Android phone I got for about $50 in 2015.
- A Garmin GPSMap 64s (a handheld GPS unit from a few years ago).
- An iPhone SE.
- An iPhone 11 Pro.
When pulling the data files, I realised the Garmin watch doesn’t record elevation! So you won’t see it in the results.
For each of the phones I used multiple gps tracking apps: the apps all gave the same results on the same device, confirming the elevation was taken from the phone’s sensors without any external dataset lookups.
The ride
I rode a 8 km (5 mile) loop around the local hills with all the devices in my backpack. The route rides alongside the ocean in a few parts, never less than a few metres above mean sea level.
Made with onthegomap.com, Map data © OpenStreetMap contributors.
Results
The on-device results were compared against NED 1m lidar data (via GPXZ), and against Strava’s elevation data.
- The cheap Android has poor results. It occasionally drops below sea level, and has a number of spurious peaks and troughs.
- The Garmin GPS performs about as well as the iPhone SE on average. It roughly follows the true elevation profile with no major false hills. I set the sample rate to the maximum but it’s still less than the others: If I were a faster rider or used the default sample rate, the elevation profile might miss small peaks.
- The iPhone SE does mostly well, though has a few sharp spikes that could cause troubles in analysis and may be long enough to survive smoothing.
- All profiles are very noisy, much noisier than the reality of the paved roads I was riding over. If using an on-device GPX file it’s probably a good idea to smooth it.
Plotting just the errors (compared to GPXZ lidar data) makes the differences between devices a bit clearer:
- The iPhone 11 Pro and Garmin GPS are always within 5m of the true elevation.
- The GPXZ dataset aligns closely with the elevation profile from Strava.
Conclusions
- Not all GPS devices record elevation! If you need to have elevation information in your application and want to support all devices or arbitrary
.gpx
file uploads, you’ll need a fallback method (like looking up elevation from the coordinates). - Elevation quality varies greatly based on devices (and further still based on signal strength). If your application needs elevation data of a certain accuracy, you may not want to rely on GPS elevations.
- At least in this case, a modern phone can outperform a dedicated GPS unit!
- For consumer devices, getting elevation from a high-quality dataset based on coordinates will be much more accurate than relying on the onboard sensor.