Re: Problem: loading soil table csv. Solved.

35 views
Skip to first unread message

Oscar A Silva E

unread,
Sep 19, 2022, 9:08:04 PM9/19/22
to QSWAT+
Problem solved.

I noticed that several soil unit names were repeated in look up table and in soil user file.

Best regards,
Oscar Silva.

El mié., 7 de septiembre de 2022 14:00, <oscar...@gmail.com> escribió:

When loading soil table (csv) in the "create HRU" interface, I receive this message:

 

Could not write to table SnDg_usersoil in database C:/QSWATPlus_Projects/SanDiegoSept01\SanDiegoSept01.sqlite from file C:/Users/oscar/OneDrive/Documentos/San Diego Bigott/Suelos San Diego/SnDg_usersoil.csv: Traceback (most recent call last):

File "C:\Users/oscar/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATPlus3_9\QSWATPlus\DBUtils.py", line 2667, in importCsv

cursor.execute(sql, tuple(line))

sqlite3.IntegrityError: UNIQUE constraint failed: SnDg_usersoil.SNAM

 

 

Please, I would appreciate any help regarding this issue.

 

Thanks,

 

Oscar Silva.

 

 

 

Biemba mwangala

unread,
Sep 30, 2022, 8:48:19 AM9/30/22
to QSWAT+
Hello Oscar,

How were you able to do it, i have having similar challenges and i have seen that indeed the soil units are repaeted several times in the look up table and User soil. Did you just delete those that are a duplication of the SNAM or  SEQN or  OBJECTID, as what i have observed is that they could have the same SNAM but different other characteristics, were you just removing those that are exacted the same in the above mentioned variables...?

Thanking you in advance.

Regards

Bob

Reply all
Reply to author
Forward
0 new messages