I know this topic has been discussed before in this forum , I read all the suggestions but I think I still have the same issue.
Working with QGIS, I'm supposed to compute the slope of river channels and then be able to classify them in classes. For that, I'm working with a DEM 90m resolution and a river network derived from the openstreetmap database.
As my DEM gave me wrong values for some slopes because it sometimes don't consider my rivers as lowest points of my valleys, I would like to run a script that enable me compute my slope using obviously the right elevations of the DEM.I've joined a picture of the network I'm working on and here are the manipulations I've done so far after many days of vain efforts.
- I decided to split my streams with the extension "Network" into segments with different lenghts and using the tool "connect" I've got nodes with IDs that increases from upstream->downstream .
- I assigned to each of these nodes its corresponding elevation from the DEM 90m
In the picture black numbers corresponds to the ID node which are classified and the red numbers correpond to the elevations!
As you can see I've circled two nodes where the algorithm I guess don't recognise the bifuraction of the river! I wonder if there's a solution to this issue too!
I've got sometimes wrong elevations at some points ( e.g the elevation sometimes increases going downstream!!) I guess it's normal because this odd point sometimes is the value of a pixel located on a tree for example in the bank river! so the correct elevation is just in the adjacent pixel !
Being not well skilled in coding, how can I go from a point in the river to the upstream and whenever there's an odd value of elevation, the script skipped it and goes to the right one upstream and then calculate the distance between the points so as to find the slope?