Bug report #14998

Invalid scripts from models with intermediate vector outputs

Added by Apus Systems - over 8 years ago. Updated about 8 years ago.

Status:Closed
Priority:Normal
Assignee:Victor Olaya
Category:Processing/Modeller
Affected QGIS version:2.14.3 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:22945

Description

When exporting a model as script, vector outputs from intermediate algorithms appear as None parameter in corresponding processing.runalg call.
Here is the exported script:

##Save Selection=name
##input=vector
##selection=output vector
outputs_QGISSELECTBYEXPRESSION_1=processing.runalg('qgis:selectbyexpression', input,'TRUE',0,None)
outputs_QGISSAVESELECTEDFEATURES_1=processing.runalg('qgis:saveselectedfeatures', outputs_QGISSELECTBYEXPRESSION_1['RESULT'],selection)

This however causes the script to fail, because algorithm 'qgis:selectbyexpression' does not need an output parameter in its .runalg call.
Here is the Console Message after running the script:

Error: Wrong number of parameters
ALGORITHM: Select by expression
LAYERNAME <ParameterVector>
EXPRESSION <ParameterString>
METHOD <ParameterSelection>
RESULT <OutputVector>

After having manually deleted the output parameter 'None', everything works as expected.
We experience the same issue with the following algorithms:

'qgis:selectbyattribute'
'qgis:selectbylocation'

as well as algorithms from user scripts.

QGIS 2.14.3
Python 2.7.9
Qt 4.8.6

Associated revisions

Revision 421251ab
Added by Victor Olaya about 8 years ago

[processing] dont use hidden outputs when exporting to python or displaying alg help

fixes #14998

Revision eb5fc90f
Added by Victor Olaya about 8 years ago

[processing] dont use hidden outputs when exporting to python or displaying alg help

fixes #14998

Conflicts:
python/plugins/processing/core/GeoAlgorithm.py

History

#1 Updated by Victor Olaya about 8 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF