I am developing a plugin in QGIS using Python language. This plugin uses algorithms from Processing Toolbox and I save some results in the temporary folder assigning QgsProcessing.TEMPORARY_OUTPUT
in the output field of each algorithm. However, my plugin is just working well when I return the temporary folder directory using QMessageBox
. If I do not use this, my plugin does not work, so nothing is saved in the temporary folder. Why this happens?
Example of code working:
clip_ndvi = Processing.runAlgorithm("saga:cliprasterwithpolygon", {
'INPUT': str(self.dlg.lineEdit.text()),
'POLYGONS': vl,
'OUTPUT': QgsProcessing.TEMPORARY_OUTPUT})
out_ndvi = clip_ndvi['OUTPUT']
QMessageBox.about(self.dlg,'teste', str(out_ndvi))
Example of code not working:
clip_ndvi = Processing.runAlgorithm("saga:cliprasterwithpolygon", {
'INPUT': str(self.dlg.lineEdit.text()),
'POLYGONS': vl,
'OUTPUT': QgsProcessing.TEMPORARY_OUTPUT})
out_ndvi = clip_ndvi['OUTPUT']
The difference is in the QMessageBox
.