The GPS (Global Positioning System) data mapped here was captured with a Garmin Edge 205. The results here are much better than the previous attempt, which must have simply been a bad GPS day. Or something. Start/finish at my office, mainly because I forgot to hit Start/Stop at the park entrance. (If you want to know how I embedded this nifty Google map with GPX overlay on this web page see the GPX Loader site.)
Elevation from the Garmin is still unreliable, unfortunately. Here's the elevation profile for this ride:
If you're wondering how I got this plot... I saved a GPX file using Garmin's Training Center. I then opened the GPX file with Excel (which, until I started fooling with this stuff, I was not aware Excel would do). The GPX only has latitude and longitude, not distance, which is what we really want. No problem: The distance between two points is given by:
acos(cos(lat1)*cos(long1)*cos(lat2)*cos(long2) + cos(lat1)*sin(long1)*cos(lat2)*sin(long2) + sin(lat1)*sin(lat2)) * r_earth
where r_earth = 3963.1 miles
Unfortunately Excel doesn't have a built-in arccosine function, so if using Excel you'll either have to resort to VBA or use several columns to store intermediate values. Afraid of writing a little code? See VBA stuff at the end of this nonsense.
After generating distance from latitude and longitude, I plotted elevation vs. distance using everyone's favorite graph software. So now you know :-)
At first glance the elevation vs. distance plot appears to be reasonable, at least the shape of it does... but there's one obvious problem: You can use Google Earth or whatever mapping software you want to find that the minimum elevation in the park is about 141 feet (bottom of Fort Hill) and the maximum is about 380 feet (near the Louisiana monument). Compare those values to the above, with a range of 37-462 feet... something's obviously amiss. Also, check out Ft. Hill: it does flatten out a bit about a third of the way up, but it definitely doesn't go downhill as shown. When we differentiate this record to get slope, some of the problems become a bit more obvious:
I know Ft. Hill is steep, but I'm pretty sure it isn't an 80% grade... or if it is, I'm a lot tougher than I think I am, and we all know that isn't possible :-) So let's try smoothing the elevation record to see what happens:
This appears more reasonable; the range in elevation isn't that far off. The grade, though, is... well...
This is better in some places, and worse in others. In particular note the 23%+ downhill slope at about 18.2 miles - the park exit at Clay Street, which is almost perfectly flat. Whoops. One problem here is that differentiation tends to blow up: small errors in the input are amplified in the slope. Increased smoothing of the elevation record will get rid of some of the extremes in grade, but at the expense of wiping out real peak values.
The short version is it doesn't look like the Garmin is going to be of much use for getting reliable elevation information, and is not suitable for calculating grade. This shouldn't be a huge surprise if you think about how GPS works: the signals are sent from satellites 22,240 miles up, so all 4 (or 5 or 6 or whatever) satellites are, in effect, looking more or less straight down at your position. Small errors in latitude/longitude will be accompanied by much larger errors in elevation. What's needed is a huge honkin' lookup table that you enter with a latitude and longitude, and retrieve an elevation. I'm looking... (Update: Using a huge honkin' lookup table)
Meanwhile, if you want to try out some of this stuff for yourself, here's a VBA routine to find the distance between two points given the latitude and longitude at those points. (Whether you use GPS for elevation or not, this will be useful sooner or later.)
Function arccos(x)
arccos = Atn(-x / Sqr(-x * x + 1)) + 2 * Atn(1)
End Function
Function latlontodistance(lat1, lon1, lat2, lon2)
' Input angles are in degrees
Dim lat1r As Double
Dim lon1r As Double
Dim lat2r As Double
Dim lon2r As Double
Dim r_earth As Double
Dim pi As Double
Dim d As Double
If (lat1 = lat2 And lon1 = lon2) Then
latlontodistance = 0
Else
r_earth = 3961.1 ' radius of Earth in statute miles
pi = 4# * Atn(1#)
lat1r = lat1 * pi / 180#
lon1r = lon1 * pi / 180#
lat2r = lat2 * pi / 180#
lon2r = lon2 * pi / 180#
d = arccos(Cos(lat1r) * Cos(lon1r) * Cos(lat2r) * Cos(lon2r) + Cos(lat1r) * Sin(lon1r) * Cos(lat2r) * Sin(lon2r) + Sin(lat1r) * Sin(lat2r)) * r_earth
latlontodistance = d
End If
End Function
To use: If you have, for example, latitude values in column A starting in row 1, longitude in column B, and distance in column C, then cell C1 should be 0 (starting point) and for cell C2 use "=C1+latlontodistance(A1,B1,A2,B2)". Then double-click the fill handle (the black square in the lower right corner) to copy this formula to all subsequent rows within the column.
Map loaded by GPX Loader Author: Bryce Nesbitt, Revision: October 2005, Licence: Freeware