20 lines
616 B
Python
Raw Normal View History

##Select by attribute=name
##Tests=group
2017-06-27 13:05:16 +10:00
#inputs
##INPUT_LAYER=vector
##OUTPUT_LAYER=vectorDestination
2017-06-27 13:05:16 +10:00
import processing
result = processing.run("qgis:selectbyattribute",
2017-06-27 13:05:16 +10:00
{'INPUT': INPUT_LAYER,
'FIELD': "id2",
'OPERATOR': 0,
'VALUE': "2"}, context=context, feedback=feedback)
result = processing.run("qgis:saveselectedfeatures",
{'INPUT': result["OUTPUT"],
'OUTPUT': parameters['OUTPUT_LAYER']}, context=context, feedback=feedback)
OUTPUT_LAYER = result['OUTPUT']