HRU creation with own soil + land use data

11 views
Skip to first unread message

Camilla Negri

unread,
Oct 11, 2025, 12:23:45 PMOct 11
to QSWAT+
Hi there,

I have prepared my own land use and soil data based to make the HRUs and I keep bumping into issues reading the look up tables. 

Specifically I always seem to get these  ValueError messages :

for land use lookup:

 line 557, in populateLanduseCodes

nxt = int(row['LANDUSE_ID'])

^^^^^^^^^^^^^^^^^^^^^^

ValueError: invalid literal for int() with base 10: 'RD'

for the soils:

line 754, in populateSoilNames nxt = int(row['SOIL_ID']) ^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: 'ONALT~~~~~A'  

I am using the 3.4 QGIS version FYI.

Any suggestions or hints as to what I could try here?

Many thanks and best wishes,

Camilla Negri 






Chris George

unread,
Oct 11, 2025, 1:28:27 PMOct 11
to Camilla Negri, QSWAT+
The LANDUSE_ID values in the landuse lookup table should all be
integers: values found in the landuse raster. Similarly with the soil
lookup table. Have you switched the columns?

Chris

On 10/9/2025 9:17 PM, 'Camilla Negri' via QSWAT+ wrote:
> Hi there, I have prepared my own land use and soil data based to make
> the HRUs and I keep bumping into issues reading the look up tables. 
> Specifically I always seem to get these  ValueError messages : for land
> use lookup:  line 557, in populateLanduseCodes
> ZjQcmQRYFpfptBannerStart
> This Message Is From an External Sender
> This message came from outside your organization.
> ZjQcmQRYFpfptBannerEnd
> Hi there,
>
> I have prepared my own land use and soil data based to make the HRUs and
> I keep bumping into issues reading the look up tables.
>
> Specifically I always seem to get these ValueError messages :
>
> for land use lookup:
>
> * line 557, in populateLanduseCodes *
>
> *nxt = int(row['LANDUSE_ID']) *
>
> *^^^^^^^^^^^^^^^^^^^^^^ *
>
> *ValueError: invalid literal for int() with base 10: 'RD'*
>
> for the soils:
>
> *line 754, in populateSoilNames nxt = int(row['SOIL_ID'])
> ^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10:
> 'ONALT~~~~~A' *
>
> I am using the 3.4 QGIS version FYI.
>
> Any suggestions or hints as to what I could try here?
>
> Many thanks and best wishes,
>
> Camilla Negri
>
>
>
>
>
>
> --
> 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 visit https://groups.google.com/d/msgid/
> qswatplus/7b6987a3-90fc-4b76-ac6d-9bafcd1154b3n%40googlegroups.com
> <https://urldefense.com/v3/__https://groups.google.com/d/msgid/
> qswatplus/7b6987a3-90fc-4b76-ac6d-9bafcd1154b3n*40googlegroups.com?
> utm_medium=email&utm_source=footer__;JQ!!KwNVnqRv!
> ByFFqOUFIICgchcYTZov4fKutw1blrhBKiv1TniVVqpdH922BnSo2ao85W5Y1YNCECYBsWRzTLrpK1qMk6S4v1k$>.

Reply all
Reply to author
Forward
0 new messages