I would like to run ogr2ogr script from a UI feature form button in QGIS, that would start some SQL script linked to the opened feature table, store the output back to database and ideally reload the layer sources.
For example:
ogr2ogr -f sqlite -update -overwrite -geomfield geom -a_srs EPSG:5514 -sql "<my_SQL_query>" <my_database>.sqlite <my_database>.sqlite -nln <my_table> -nlt linestring
I have tried to search for some tutorials, but generally I have found some on creating plugins for QGIS.
1 Answer 1
This use case should be covered by the answers to Execute ogr2ogr from python.
If it doesn't, please provide some more details on how the situation differs.
-
That could be it. How can I define this function to be run on click button action in the form? I suppose the script has to be loaded on form load (python init code) and also point to the button object name.Albine Pro– Albine Pro2022年08月09日 06:24:14 +00:00Commented Aug 9, 2022 at 6:24