[GIS] Advanced forms with QT designer

attribute-tabledatabaseqgisqt-designer

I have a QGIS project where a SHP-layer contains the IDs of plots besides vector data.

I want to create a form with QTDesigner which enables me to enter the contact information of the landowner(s) for each plot in QGIS. So by clicking on the "identify features"-button the form should open and then I should be able to enter the landowner information. The plot-ID should be a value that is determined and can't be changed.

My biggest question is, how I can consider that some plots can have several, up to 20 land owners. So obviously having all this data on one form is not very good. It should be separated and selectable (tabs, or a drop down menu).

My idea how to handle this in such cases:

I enter the data (street, town, ZIP, phone number) of the first landowner then I push "OK" thus creating a dataset "landowner1". After this I'm still on the same form, but all the fields where I can enter the contact information are empty again and now I can enter the data for "landowner2", and so on. Since the data would be stored in the attribute table I would also have street1, street2,… town1, town2, … etc. for each landowner.

Later all this data should be accessible via the "identify feature" and I can select in a dropdown-menu or -list between the landowners.

How can I achieve this?

Please note that I'm have almost no idea about Python or programming. I'm using QGIS 2.12.0.

Best Answer

What you want to do is to hide GIS/Database functionality behind a simple GUI, legitimate approach imho.

This question thus has two aspects:

1) From the database point of view, you have a m:n cardinality join from plots to landowners (a plot can be owned by n landownder an vice versa, a landowner can own m plots). Such is usually achieved by an intermediate table in which the relations are stored. So design the database in an appropriate way first.

2) One thing (the easy part) is to design a customer GUI with the QtDesigner, but so it is not done. Furthermore you need to implement the logic behind your GUI, which is just done in Python. Since you have 'almost no idea' (which means to me you have little idea), I recommend you to take advantage of this oportunity to start with Python. It will help you anyway.

Related Question