I´m working with Qgis 2.6.1 and GRASS.

I have used the r.watershed module to create a flow accumulation map. With r.mapcalc I have extracted the river network, then i´m using r.thin to thin out to a single pixel width the lines on the binary raster map.

Then I'm using r.to.vect.line to convert raster to vector lines. Everything looks good however the network doesn't have smooth corners ... please look at the picture, my rivers are blue.

Can I change something in this procedure to diminish this effect?

enter image description here

  • Most likely your region settings have a resolution that is too coarse. What does g.region -p give you? What is the resolution of the original elevation data?
    – Micha
    Jun 4, 2015 at 19:19
  • elavation data as 30 m. Sorry I´m new with Qgis, how do I use g.region -p?
    – user53161
    Jun 4, 2015 at 21:16
  • projection: 3 Zone: 0 datum: wgs84 ellipsoid: wgs84 north:3:46:41.52S south:18:29:02.4S west: 9:45:52.56E east: 25:55:01.2E nsres: 0:00:54.578277 ewres: 0:00:54.548443 rows: 970 cols: 1066 cells: 1034020
    – user53161
    Jun 4, 2015 at 21:20

2 Answers 2


It looks like, from the docs: http://grass.osgeo.org/grass70/manuals/addons/r.to.vect.lines.html that there is a skip parameter. The default is 10 so perhaps if you reduce it you will get more points.

It looks like there's a smoothing function in grass too: http://grass.osgeo.org/grass64/manuals/v.generalize.html

with tutorial:


Please post a pic of the resulting vectors if this works! I'd love to see it.

  • I´m new to grass and Qgis. Can you tell me how can I change the skip parameter? Where do I do this, GRASS console? python console...
    – user53161
    Jun 4, 2015 at 9:54
  • are you running windows or linux? did you run r.to.vect from qgis or from grass? Jun 5, 2015 at 0:40
  • I´m running Windows grass
    – user53161
    Jun 5, 2015 at 7:35

From your comment, above, regarding region settings, you mentioned that the original DEM is 30 meter resolution. In a WGS84 Long/Lat coordinate system, with degrees as units, that should be about 1 arc-sec. But in your second comment you can see that the resolution ("Computational region" in GRASS terms) is about 54 seconds. Your region covers about about 15 degress N-S and E-W, approximately 1600 km. But it is divided into only 960X1066 rows and columns. So each pixel covers about 1600 x 1600 meters, instead of 30 meters as in the original DEM. That's why your stream network looks "zigzagged".

In short, you need to set the region settings in GRASS with something like:

g.region -p res=0.000283  

(The res= setting is the decimal equivalent of 1 arc-sec)

or alternatively, just set the computational region to match the original DEM raster:

g.region -p rast=<YOUR DEM> 

I should add that for your region of 1600 km x 1600 km, a resolution of 30 meters per pixel will give you a huge number of pixels. It will be about 51,000 rows x 51,000 columns (instead of the 960x1066 above) which means 2,840,000,000 total cells: probably too much to process on a regular computer. So you probably will want to choose a resolution of 100 meters or 250 meters instead of the 30 meters from the original DEM.

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.