2

I'm trying to figure out the best approach to achieve the following:

  1. A user selects a single or group of features.
  2. Option to access a popup box with a set of dropdowns populated by DB query.
  3. The user saves, and a database query is run.
  4. PostGIS layers are refreshed.

One thing to note is that the PostGIS layer the user will be selecting features from is a view query, so the update needs to be made to different tables.

Could anyone point me in the right direction of what to research/look at? I'm wondering if I would have to write a plugin?

2

Without coding a plugin (although it can do exactly what is wanted in terms of algorithm, query and design), I think it's possible to achieve what you want with the QGIS interface for just one feature selected. For a group of features, I think the only way (for have a dialog with comboboxes that update selected datas) is a PyQGIS plugin.

If you want to develop a QGIS plugin, take a look at useful plugins :

  • Plugin Builder (for create with few clicks base files for a working plugin)
  • Plugin Reloader (reload the developed plugin without quit QGIS)

For software :

  • Qt Creator for edit the .ui dialog interface file (software package with QGIS installation)
  • Qt Assistant for documentation of Qt object classes

For code :

  • Python 3 and QGIS Python API
  • PyQt (for connection with database, I recommand you to look at QSqlQuery Qt class.
|improve this answer|||||
  • Thanks for this. I ended up just writing the plugin! – user3412 May 29 '19 at 20:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.