Thursday, 22 December 2016

Enable layer plugins when using external standalone QGIS python scripts


I created a QGIS standalone script (custom Application) that enables me to automatically export Atlas as images.


The problem is that in my QGIS project, I'm using a Mask plugin and the generated images don't take into consideration this plugin (even if I install it on /usr/share/qgis/python/plugins) when executing my script in a standalone way whereas when I manually export Atlas as images using QGIS desktop and the same project, the plugin is activated and the mask is done correctly in the generated images.


I also tried to use the API sys.path.append('/usr/share/qgis/python/plugins') just after the qgs.initQgis() and also QgsApplication.setPrefixPath("/usr/lib/qgis", True) (tested also with /usr/share/qgis andn /usr folder) before the QgsApplication([], True) without more success.


Is there a specific API to use when executing standalone scripts so that QGIS engine enables layers plugins?



I also created an issue on the Mask plugin project in case.




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...