Geocoding means recording the GPS location of a point (a waymark) or a route.
So, you have a GPS device, like a smartphone, and want to record your route - distance and ascent. It should be really accurate - right?
The distance measurement is very accurate, so long as you:
So, assuming you stopped recording while you were stationary, the distance measurement will be very, very accurate (if you didn't stop, editing out the random 'stop' points in the GPS record isn't easy). With a good GPS device, and a clear view of the sky, accuracy will be within 3 metres 95% of the time. (so 5% of the time, it will be greater than 5 metres, as it will be without a clear view of the sky)
A typical GPS device will record 1 point every metre. So a walk's GPS route may have 20,000 points. Software - websites like OS Get-a-map or the PC applications like Anquet/Memory Map, can compact the route by smoothing it to a more reasonable 200 to 300 points or so by reducing the accuracy to within a tolerance of 5 metres or so. Its also a bit easier to display a line with 300 points, rather than a line with 20,000 points. Smoothing works by using a mathematical algorithm to:
Elevation accuracy however, isn't so good. First GPS isn't as accurate for elevation as it is for horizontal location. Second, all those small errors are significant compared to the figure you are trying to measure. 20,000 figures each with 5m (clear sky) to 15m (near trees, cliffs, the 5% of the time) errors add up to a significant proportion of the figure you need to measure. For example, say you are walking on a flat path, the device may measure 4, 5, 4, 5, 6, 5 , 3, 5, 3, 5, 5 (6m of ascent over 11 points, so how many over 20,000... ). The inaccuracies are much worse near trees or buildings. On a 20km walk, the ascent can easily b overestimated by 500 metres - more if the device wasn't switched off when stationary
The way to fix this is to smooth the figures (remove the small ups and small downs). But to do this you have to remove so many ups and downs you actually remove some of the ones that really existed and that you needed to measure.
It turns out that the best way by far to record elevation accurately is to actually discard the figures that your device records, and use a GPS route mapping website which uses an Elevation Service instead. These calculate the elevation from satellite radar measurements of the earth's surface. Google for example have an elevation service with a 50m grid of height measurements for the world's surface. Give it a location, and it will extrapolate the elevation for you. Fine, unless you are near a cliff, in which case it will say you are half way up, rather than at the top or the bottom. The UK's Ordnance Survey have a contour (i.e. vector rather than grid) based product, which should be exceptionally accurate, but it is not clear which websites use it.
These issues explain why there are often so many differing ascent figures for given walk. Smoothing out ups and downs of less than 5 metres will give a different figure from smoothing to a tolerance of 10, 15 or even 50 metres. There is no 'correct' answer.
In summary, to measure a route accurately, mark it up on a GPS mapping website, and let it calculate the distance and altitude gain/loss for you.
Elevation gain or loss is straightforward, but absolute height is a little more tricky