I have used the grass function r.watershed to get the river network by calculating the accumulation. However, as an output when I want to extract the river network by applying a filter on the accumulation (Number of cells that drain through each cell) I get a raster and then when I extract it in a shapefile I get both right side and left side of the river network. My goal is to extract only the middle line of the river network. How can I do that ?

1 Answer 1


The typical use of r.watershed would include an output raster of streams (and another raster of basins) based on the user's chosen threshold value. Then that stream raster is converted to a line vector using two simple commands:

r.thin input=streams output=streams_thin
r.to.vect input=streams_thin output=streams type=line 

The streams raster is derived from flow accumulation, but there's no need for any filter. Just enter the required threshold value.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.