Bug report #16982
TauDEM Stream and watershed delineation
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | Alexander Bruy | ||
Category: | Processing/Core | ||
Affected QGIS version: | 2.18.9 | Regression?: | No |
Operating System: | Easy fix?: | Yes | |
Pull Request or Patch supplied: | Yes | Resolution: | fixed/implemented |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 24881 |
Description
There is an issue with how QGIS calls the TauDEM executable "StreamNet" from the command line. The "delineate single watershed" option has the reverse effect: leaving the box unchecked results in a single watershed, whilst checking the box leads to multiple subwatersheds being delineated.
The issue is due to the "-sw" flag (single watershed option): in the description, the boolean parameter value for the "-sw" parameter is set by default to "False" and in the python script "../python/plugins/processing/algs/taudem/TauDEMAlgorithm.py" line 114-116
"
elif isinstance(param, ParameterBoolean):
if not param.value:
commands.append(param.name)
"
a None value results in the parameter name, in this case "-sw" being appended to the command line. A simple fix is to edit line 115 to (see attached file)
" if param.value:"
which ensures that the flag is only added when a user checks the option, giving the parameter a value of 1, as expected.
History
#1 Updated by Giovanni Manghi over 7 years ago
- Operating System deleted (
Windows 7) - Assignee changed from Victor Olaya to Giovanni Manghi
#2 Updated by Alexander Bruy about 7 years ago
- Assignee changed from Giovanni Manghi to Alexander Bruy
#3 Updated by Alexander Bruy about 7 years ago
- Resolution set to fixed/implemented
- Status changed from Open to Closed
Should be fixed