Assertion Error while creating floodplains through DEM Inversion Landscape Creation

30 views
Skip to first unread message

Rishabh Srikar

unread,
Jun 11, 2024, 3:57:08 PMJun 11
to QSWAT+
Hi everyone, 
I too am at the first step of running QSWAT+, i.e, watershed delineation, and am running into an error while attempting to create floodplains using the Create Landscape Tool. Specifically, I run into an error while using the DEM inversion and the Branch Length approaches; the tool doesn't run with the following error log:

2024-06-11T12:30:20     WARNING    Traceback (most recent call last):
              File "C:\PROGRA~1/QGIS33~1.7/apps/qgis-ltr/./python/plugins\QSWATPlus3_12\QSWATPlus\landscape.py", line 611, in generate
              ok = self.calcHillslopes(self.channelThresh, self.clipperFile, root)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              File "C:\PROGRA~1/QGIS33~1.7/apps/qgis-ltr/./python/plugins\QSWATPlus3_12\QSWATPlus\landscape.py", line 277, in calcHillslopes
              dem, isNew = self.clipRaster(self._gv.felFile, clipperFile, root)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              File "C:\PROGRA~1/QGIS33~1.7/apps/qgis-ltr/./python/plugins\QSWATPlus3_12\QSWATPlus\landscape.py", line 256, in clipRaster
              assert os.path.exists(clipFile), 'Failed to create clipped raster {2} by clipping {0} with {1}'.format(inFile, clipperFile, clipFile)
              ^^^^^^^^^^^^^^^^^^^^^^^^
             AssertionError: Failed to create clipped raster C:/Users/seema/Desktop/Rishabh/SWAT+/Dindori_1\Watershed\Rasters\DEM\Dindori_Extent_UTMfelclip.tif by clipping C:/Users/seema/Desktop/Rishabh/SWAT+/Dindori_1\Watershed\Rasters\DEM\Dindori_Extent_UTMfel.tif with C:/Users/seema/Desktop/Rishabh/SWAT+/Dindori_1\Watershed\Shapes\Dindori_Extent_UTMsubbasins.shp


From what I understand this is a masking error during an intermediate step in the process, but I don't know why this is occurring. All my rasters (only DEM only at this step) and shapes are projected (EPSG: 32644, UTM). Can anyone shed a light on what might be going wrong and how should I proceed to correct it? 


Thanks for your time!

Rishabh

Rishabh Srikar

unread,
Jun 14, 2024, 9:03:54 AMJun 14
to QSWAT+
Hi everyone, solved my particular issue. It had to do with the versions of QGIS, QSWAT+, SWAT+ Tools and SWAT+ Editor used but I've been down a rabbit hole this past week and hope that my post clears some relevant doubts that others may have.

I had done my prep before posting my issue here and want to clarify that the versions recommended in the manual and at the github forum are not very clear at all, perhaps even being slightly misleading as of June 2024.
Depending on the source, it is sometimes recommended to use the latest QGIS version and at other times the latest LTR versions. Furthermore, the QSWAT Installer recommended based on compatibility with the Python versions (used by QGIS) does not always work out. For example, I was using QGIS 3.34.7 (Pirzen) LTR with QSWATPlus3_12install2.5.2.exe which are supposedly compatible on paper, but this still resulted in several tools not running successfully. It was only upon retracing Mr. Celray James' Open Water Network Tutorial on YT and precisely using the versions of the software (mostly from 2019) in the tutorial including MSMPI that I was able to delineate my watershed and floodplains correctly.  

In this regard, I would request the folks at TAMU (if they are active on the group) to please update the manual and the Github forum with the appropriate combinations of the software versions that run all tools successfully. Several issues raised here in the group seem to be emanating from such incompatibilities and it would be rather convenient if there was a periodically updated as well as consistent guide that all new users may follow. 

Hope some of you may find this useful, 
Rishabh

Reply all
Reply to author
Forward
0 new messages