I have been playing around with the GPS functionality of the iPhone for a while now and I think I have optimized the collection of in-plane GPS data as best as possible given the limitations of the hardware. The iPhone was not created to be a garmin forerunner and this especially shines through when you try to get elevation data out of the iPhone GPS. This became painfully obvious after I built the functionality for collecting and displaying elevation data from the GPS. Even after creating sophisticated methods for filtering the GPS data and averaging the data and weighing the data by the vertical accuracy the graphs of the running data had no correlation with reality. At first this was disappointing – I had created this great code for collecting, saving, and displaying the elevation data but clearly if I released an app which was going to show unrealistic elevation data – the app would get killed by bad reviews.
So I looked around for other places to get elevation data. Turns out that the space station has used lasers to measure elevation all over the surface of the earth and that Google has an API which allows you to query that data. This means much better resolution on the elevation data than a GPS (even a garmin) could ever provide and I can show elevation data for both current routes as well as routes that have been saved which have no elevation data saved with them. The only issue is that a data connection is required in order to get at this data but the amount of data being sent back and forth is so small that the elevation data shows up almost instantly even on an EDGE connection. Being a good citizen I only have the app request elevation data if the user is interested in seeing this type of data – this keeps data usage down and keeps load off Google’s servers.
The video below shows how the elevation data is displayed within the app.