3

I am using QGIS and use r.stream.extract to extract the stream lines from a single DEM tile. However, this takes long (about 15 minutes) to complete, especially for a rugged terrain. I plan to extract streams for a much larger area with several merged DEM tiles (in geopackage format), but I am worried it will take even longer.

Is there a faster way to extract the streams (preferably using command line tools like ogr2ogr)?

3

Try using non-default parameters to avoid useless creation of very small river branches.

In particular I would advise to play around with the following parameters, setting them to higher values.

  • threshold -> Set to larger values, to avoid the creation of smaller branches in first place. (threshold units are expressed in pixels).
  • stream_length -> Set to values larger than 0 to delete smaller branches in the final files. (stream_length units are expressed in pixels).
  • memory -> increase to larger values (for example 1024, meaning the process will use up to 1024MB i.e. 1GB of memory). This will have no influence on smaller dataset, but make your day for larger ones. As a rule of thumb, the larger the input raster, the larger the assigned memory must be.

From the manual:

threshold=float [required] Minimum flow accumulation for streams. Must be > 0

stream_length=integer Delete stream segments shorter than stream_length cells. Applies only to first-order stream segments (springs/stream heads) Default: 0

memory=integer Maximum memory to be used (in MB) Cache size for raster rows Default: 300

Edit

As per OP's request, using the GUI these are the parameters to tweak (i.e. increase):

enter image description here

2
  • 1
    Thank you for the info. But I am using only r.stream.extract via QGIS, and I am not familiar with using GRASS. Could you please suggest how I could set those settings in QGIS? – JAT86 Jan 14 '20 at 16:44
  • 1
    Post edited, see screenshot. – RafDouglas Jan 14 '20 at 21:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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