This is for a recreational/hobbyist type application.
I want to calculate the grade of sloping ground (ski slopes, actually). I have points my GPS unit that I carry with me while skiing, spits out.
I used the Haversine formula to calculate the distance between the two points, and the USGS elevation web service to fetch the elevations. The problem is, that in not a small number of cases, I am getting grades greater than 100%. That is, the Haversine formula produces a distance, less than the difference between the elevation at the two points, and so rise/run is greater than 100%. I am doing this only for a minimum vertical drop of 100 feet at a time, so I am not dividing super-tiny distances to produce this result.
Can anybody help me out with how to approach this type of calculation? Is it simply that the elevation databases are not accurate enough for what I want to do? Would the Haversine formula be the correct way to compute the "run" part of rise/run? Do you have another suggestion for how to approach this problem?
Thanks much if you can take a few minutes to think about this and reply!
I would suspect inaccuracies in both the GPS locations and the elevation database. The former is a function of the quality of the GPS reciever - recreational GPS is accurate to only 5 meters at the best. Unfortunately, the only way to acquire accurate values is to rent a survey-grade (centimeter accuracy) GPS receiver (not cheap) and use its location & elevation data to calculate the slopes.
Sorry I cannot provide a better answer.