Usersoil creation / Incorrect number of bindings supplied / SLC (Canada data)

14 views
Skip to first unread message

Camilla Negri

unread,
Oct 16, 2025, 11:28:02 PMOct 16
to SWAT-user
Hello everyone,

I am trying to make a usersoil table for soils in Canada and I am using  this dataset:

Cordeiro, Marcos R C; Lelyk, Glenn; Kröbel, Roland; Legesse, Getahun; Faramarzi, Monireh; Masud, Mohammad Badrul; McAllister, Tim (2017): Deriving Canada-wide soils dataset for use in Soil and Water Assessment Tool (SWAT) [dataset]. PANGAEA, https://doi.org/10.1594/PANGAEA.877298, Supplement to: Cordeiro, MRC et al. (2018): Deriving a dataset for agriculturally relevant soils from the Soil Landscapes of Canada (SLC) database for use in Soil and Water Assessment Tool (SWAT) simulations. Earth System Science Data, 10(3), 1673-1686, https://doi.org/10.5194/essd-10-1673-2018

Has anyone got experience with that? I am making the usersoil table from this data and I am encountering a series of errors. Here are some examples and questions, hopefully one of you can help provide clarification...

1)  does the current QSWAT+ usersoil (using QGIS 3.4 stable version) need the columns Impervious and Depth?

2) how many columns are necessary? I get errors when I provide a "small" number ( line 2706, in importCsv cursor.execute(sql, tuple(line)) sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 11, and there are 17 supplied. even though the new table has 17 columns  ) as well as larger numbers of columns ( line 2706, in importCsv cursor.execute(sql, tuple(line)) sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 152, and there are 55 supplied.  )
3) datatype mismatch error   "line 2706, in importCsv cursor.execute(sql, tuple(line)) sqlite3.IntegrityError: datatype mismatch" 
4) is the library(SWATprepR) up to date and are the examples also useful for QSWAT?

Many thanks and best wishes,
Camilla Negri

Chris George

unread,
Oct 17, 2025, 8:46:22 AMOct 17
to Camilla Negri, SWAT-user
I can perhaps answer some of your questions.

1. csv files have to match the columns expected. Whether the data is
used is another matter beyond my competence.

2. There are two possible styles of soil data accepted by QSWAT+, a
single file with 152 columns, or a main file of 11 columns with a
separate file of layer data. Look at the data in the Robit example to
see example files of both kinds. QSWAT+ will accept the single file or,
initially, the main file, choosing between them by the number of columns
in the csv file.

3. You need to check line 2706 and see what is wrong. Perhaps a null
field, or a letter in a number field.

4. Can't help you on this one.

Chris


On 10/16/2025 5:14 PM, 'Camilla Negri' via SWAT-user wrote:
> Hello everyone, I am trying to make a usersoil table for soils in Canada
> and I am using  this dataset: Cordeiro, Marcos R C; Lelyk, Glenn;
> Kröbel, Roland; Legesse, Getahun; Faramarzi, Monireh; Masud, Mohammad
> Badrul; McAllister, Tim (2017): 
> 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/1f5e705a-974e-4211-af19-e40b91794633n%40googlegroups.com
> <https://urldefense.com/v3/__https://groups.google.com/d/msgid/
> swatuser/1f5e705a-974e-4211-af19-e40b91794633n*40googlegroups.com?
> utm_medium=email&utm_source=footer__;JQ!!KwNVnqRv!
> BXzo8G0bKW5MxxJRbCp1sK5T09LAZcgWxZGHS_nNmjaWb3iVD0BF1SsHLrLAefOKVbOkn1CnZ9uQoEX6hNiAKw$>.

Reply all
Reply to author
Forward
0 new messages