I wanted to use temporary results in my pyqgis script just like
import processing
from qgis.core import *
carte_init=processing.getObject("carte_postes")
extent = "%s,%s,%s,%s" % ( carte_init.extent().xMinimum(),
carte_init.extent().xMaximum(), carte_init.extent().yMinimum(),
carte_init.extent().yMaximum() )
# Exrtacting test posts centroids
postes= processing.runalg('qgis:saveselectedfeatures', carte_init, None)
centroides_postes=processing.runalg('qgis:polygoncentroids',
postes['OUTPUT'], None)
voronoi_max_extent=processing.runalg('grass7:v.voronoi',
centroides_postes['OUTPUT'], False, False, extent, -1, 0, 0, None) }
But I get the following when I run it in the python console...
Traceback (most recent call last):
File "<input>", line 1, in <module>
KeyError: 'OUTPUT'
As it works perfectly well in this script
import processing
from qgis.core import *
layer=processing.getObject("carte")
layer.invertSelection()
tampon_plus = processing.runalg('qgis:fixeddistancebuffer', layer,
"20","5",False, None)
dissolve = processing.runalg('qgis:dissolve', tampon_plus['OUTPUT'], True,
None, None)
carte_finale = processing.runalg('qgis:fixeddistancebuffer',
dissolve['OUTPUT'], "-20","5",False,
"c:/Users/LENOVO/Desktop/zones/carte_finale.shp")}
I wonder where is my mistake. I tried to use algorithm ['Result'] just as in Saving layer as temporary file usig PyQGIS? but it's not working any better.