I am working on a project where I needed to study soil types at my research location. I am using SOTER. Just for record, I am working in QGIS 2.6 Brighton.

What I have ?

  1. A shapefile (with 25 features). Each of these features have a linkfield column. this column has id that can be used as foreign key to SOTER database

  2. SOTER database with multiple tables: Terrain, TerrainComponent, SoilComponent and Profile are the ones I am interested in.

Data Structure::

Terrain table has 17 fields with SUID 1 to 17. "linkfield" of shapefile will be linked to this

Terrain Component table has more than 50 fields, each SUID can have 2-4 terrain components - represented by TCID column

Soilcomponent table assigns at least 2 to 4 different components to each TCID - represented by SCID. this table also has PRID in each row. Thus, each SCID of each TCID of each SUID has 1 distinct PRID that can be linked to Profile table

Profiles table has WRBC column that I am intersted in.

What have I done?

  1. Created relations in QGIS with following parameters
    1. linked SUID of Terrain to linkfield of shapefile
    2. linked SUID of TerrainComponent to linkfield of shapefile
    3. linked SUID of SoilComponent to linkfield of shapefile
    4. linked ProfileID (written as PRID) of Profiles table to PRID of SoilComponent

Now when I click over any feature in shapefile, (with auto-open form) I can navigate to find a column called: "WRBC" of Profile table which has the actual data that I need. I have attached a sample form of a feature of shapefile.

A sample form

What do I need ?

Now I need to be able to extract all the types of PRIDs that are referred by the "linkfield" from shapefile. And I need to save this into a new table.

The format of the table could be like:

linkfield    PRID     WRBC  
1            NP111    its value  
1            NP124    its value  
1            NP214    its value  
2            NP623    its value  
2            NP155    its value  
2            NP124    its value  
3            NP214    its value  
3            NP623    its value  

and so on...

I need this table for manual study and then later I need to reclassify this data on the basis of the value in WRBC column.

Am I doing anything wrong? If not how can I proceed?

  • You are using a very old outdated QGIS. Now it is 2.18.17 long term release (LTR) and recently QGIS 3.0 was released. It is better to update your QGIS at least to the LTR release. – ahmadhanb Mar 13 at 8:43
  • @ahmadhanb I know. I tried using newer version but I need to use QSWAT which would not run in newer versions. The QSWAT website specifically told be to use this version of QGIS. – anup Mar 13 at 8:45

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.