Problems with create HRUS

175 views
Skip to first unread message

Xiao Zhang

unread,
May 19, 2021, 12:17:39 PM5/19/21
to QSWAT+

Hi, I have met with this problem when I tried to create HRUs by "Fliter by landuse, soil, slope". Does anyone know how to handle this?


2021-05-19T15:14:56     CRITICAL    Failed to create HRUs: Traceback (most recent call last):
              File "C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python/plugins\QSWATPlus3_64\hrus.py", line 5358, in calcHRUs
              self.CreateHRUs.printBasins(True, fullHRUsLayer)
              File "C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python/plugins\QSWATPlus3_64\hrus.py", line 2822, in printBasins
              self.printBasinsDetails(basinHa, True, fw, curs, fullHRUsLayer, horizLine)
              File "C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python/plugins\QSWATPlus3_64\hrus.py", line 2951, in printBasinsDetails
              self.writeActHRUs(fullHRUsLayer, subIndx, chIndx, catIndx, areaIndx, hrusIndx)
              File "C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python/plugins\QSWATPlus3_64\hrus.py", line 3235, in writeActHRUs
              self.createHrusResultsFile(actHRUsFile, root)
              File "C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python/plugins\QSWATPlus3_64\hrus.py", line 3381, in createHrusResultsFile
              jsonFile.write(exporter.exportFeatures(provider.getFeatures()))
             Exception: unknown

Chris George

unread,
May 19, 2021, 12:32:33 PM5/19/21
to Xiao Zhang, QSWAT+
I have never seen this error before, and the message about an 'unknown'
exception is not very helpful! If you send me a zip of your project
directory I will investigate.

Chris
> --
> You received this message because you are subscribed to the Google
> Groups "QSWAT+" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to qswatplus+...@googlegroups.com
> <mailto:qswatplus+...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/qswatplus/e384fe29-e33c-4c05-9b78-d3b7dd01148dn%40googlegroups.com
> <https://groups.google.com/d/msgid/qswatplus/e384fe29-e33c-4c05-9b78-d3b7dd01148dn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Xiao Zhang

unread,
May 19, 2021, 12:39:17 PM5/19/21
to QSWAT+
OK. But the project is a bit large, like 12G unzipped. How can I send this file to you?

Xiao Zhang

unread,
May 19, 2021, 5:05:28 PM5/19/21
to QSWAT+
I tried with the new QSWATPlus  version  2.1.0, the HRU was created successfully with "Fliter by landuse, soil, slope". The version I got this problem is 2.0.6. Maybe the new version have fixed this problem. Though I don't know why, the result is good. Hope it won't happen again.

Xiao Zhang

unread,
May 25, 2021, 9:35:06 AM5/25/21
to QSWAT+
Hi Chris,
I met this problem again with version 2.1.0. I totally confused. How can I send my project to you? 

Nordino Paluluane

unread,
May 30, 2022, 9:08:38 AM5/30/22
to QSWAT+
Hello

Tell me please if ypu have found the solution for this problem, I'm getting this error message using QSWAT+ 2.2.4 and 2.2.3 when using multiple HRUs option.

Screenshot 2022-05-22 113438.png

Josh Hartmann

unread,
Oct 21, 2022, 11:10:05 AM10/21/22
to QSWAT+
I too am having the same issue when trying to create HRUs. This is with "Filter by landuse, soil, slope" (both by area and percentage), the other methods work as expected.

Failed to create HRUs: Traceback (most recent call last):


File "/usr/share/qgis/python/plugins/QSWATPlusLinux3_64/QSWATPlus/hrus.py", line 5515, in calcHRUs

self.CreateHRUs.printBasins(True, fullHRUsLayer)

File "/usr/share/qgis/python/plugins/QSWATPlusLinux3_64/QSWATPlus/hrus.py", line 2946, in printBasins


self.printBasinsDetails(basinHa, True, fw, curs, fullHRUsLayer, horizLine)


File "/usr/share/qgis/python/plugins/QSWATPlusLinux3_64/QSWATPlus/hrus.py", line 3079, in printBasinsDetails


self.writeActHRUs(fullHRUsLayer, subIndx, chIndx, catIndx, areaIndx, hrusIndx)


File "/usr/share/qgis/python/plugins/QSWATPlusLinux3_64/QSWATPlus/hrus.py", line 3363, in writeActHRUs

self.createHrusResultsFile(actHRUsFile, root)

File "/usr/share/qgis/python/plugins/QSWATPlusLinux3_64/QSWATPlus/hrus.py", line 3509, in createHrusResultsFile

jsonFile.write(exporter.exportFeatures(provider.getFeatures()))

Exception: unknown

This is with:

QSWAT 2.2.3
Python 3.8.10
QGIS 3.22.11
QT Version 5.12.8
GDAL/OGR Version 3.0.4
Ubuntu 20.04 LTS

Thanks,

Josh
Reply all
Reply to author
Forward
0 new messages