I am trying to find sections of road with steep gradients.
My process is:
- pull a linestring from Openstreetmap data
- resample it to create a point every 10 metres
- look up the height data for each point from ASTER Global Digital Elevation raster
- calculate the gradient at 10m intervals and look for any in excess of 14%
This works but throws up a LOT of anomalies which must be due to the height data as I have ridden my bike along these sections. One 10m section on a road segment local to me shows a height difference of 14m between two points 10m apart on the line.
Now clearly this is due to the height data. It is stated to have an accuracy of:
20 meters at 95 % confidence for vertical data and 30 meters at 95 % confidence for horizontal data.
How should I go about smoothing out these anomalies and having a best guess at where the steepest road gradients really are?
Everything has been written in PGPLSQL/POSTGIS so far. I have a set of line strings with points every 10m and a height for each point.