HRU challenge

0 views
Skip to first unread message

MOKUA RETANG (Dr Reti)

unread,
12:26 PM (4 hours ago) 12:26 PM
to SWAT-user
Hi SWAT users

Can anyone assist with the following error when trying to create HRUs.I am not familiar with coding, so I don't know how to interpret and fix this python error

2026-02-27T15:53:42     WARNING    Traceback (most recent call last):
              File "C:\Users/RetangM/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATPlus\QSWATPlus\hrus.py", line 5569, in readFiles
              OK = self.CreateHRUs.generateBasins(self._dlg.progressBar, root)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              File "C:\Users/RetangM/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATPlus\QSWATPlus\hrus.py", line 918, in generateBasins
              crop = self._db.translateLanduse(int(crop))
              ^^^^^^^^^
             ValueError: cannot convert float NaN to integer

I will appreciate your assistance


Regards

Retang

Chris George

unread,
12:32 PM (4 hours ago) 12:32 PM
to MOKUA RETANG (Dr Reti), SWAT-user
It looks like your landuse raster is returning a NaN when being read,
which is very strange. If you cannot find the problem in this file send
me your complete project folder and I will investigate.

Chris


On 3/2/2026 8:54 AM, MOKUA RETANG (Dr Reti) wrote:
> Hi SWAT users Can anyone assist with the following error when trying to
> create HRUs. I am not familiar with coding, so I don't know how to
> interpret and fix this python error 2026-02-27T15: 53: 42     WARNING
>    Traceback (most recent call last): 
> ZjQcmQRYFpfptBannerStart
> This Message Is From an External Sender
> This message came from outside your organization.
> ZjQcmQRYFpfptBannerEnd
> --
> You received this message because you are subscribed to the Google
> Groups "SWAT-user" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swatuser+u...@googlegroups.com
> <mailto:swatuser+u...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/
> swatuser/a8e3fde2-7a5f-4b1a-83c3-5cfa660d579en%40googlegroups.com
> <https://urldefense.com/v3/__https://groups.google.com/d/msgid/swatuser/
> a8e3fde2-7a5f-4b1a-83c3-5cfa660d579en*40googlegroups.com?
> utm_medium=email&utm_source=footer__;JQ!!KwNVnqRv!DoNq8ODhRXNN415UDHXxn-
> E2VPBbRyMjubINbu2L7sag7AWgStCwbP3sID1j3SrNL2WZvM0UNJ52xA$>.

Reply all
Reply to author
Forward
0 new messages