It may also depend on the algorithm. For example, the Ordinary Kriging
from SAGA returns two outputs (VARIANCE
and PREDICTION
), but other SAGA algorithm outputs are called OUTPUT
. So, you cannot just use a single output name for all algorithms in a provider.
However, there is a way to get output parameter names from any Processing algorithm. We can define the following function (for instance in the QGIS Python console):
import processing
def getAlgOutputNames( algName ):
for output in processing.Processing.getAlgorithm(algName).outputs:
print output.name
You can call the function in this way, giving it algorithm names you're interested in:
>>> getAlgOutputNames("grass7:v.surf.idw")
output
>>> getAlgOutputNames("qgis:creategrid")
OUTPUT
>>> getAlgOutputNames("saga:ordinarykriging")
PREDICTION
VARIANCE
>>> getAlgOutputNames("gdalogr:clipvectorsbypolygon")
OUTPUT_LAYER
>>> getAlgOutputNames("lidartools:lasmerge")
OUTPUT_LASLAZ
>>> getAlgOutputNames("taudem:dinfinityavalancherunout")
-rz
-dfs
>>>getAlgOutputNames("otb:radiometricindices")
-out
Note: Remember that you can get algorithm names calling processing.alglist()
from the QGIS Python console.