I am using QGIS 3.0.
Following up on Calling a QgsProcessingAlgorithm from a Processing python script in QGIS 3.0?, I am writing a Processing
python script based on the template provided here.
It takes a few additional parameters in addition to the 'INPUT'
and 'OUTPUT'
from the template. I am using these parameters to create some lines and everything works out fine.
Now I need to call a Processing
Algorithm, namely qgis:clip
to clip the lines I just created according to the Polygon entered as 'INPUT'
.
Is there a way to pipe my output into qgis:clip
? Or do I need to create a temporary layer that I will then feed into qgis:clip
and let it's 'OUTPUT'
become mine ?
Either way, I'm not sure where to start.
I've tried defining a QgsFeatureSink
or a QgsProcessingFeatureSink
but the first is an abstract thingy and the second just won't be recognized (I can't even import it from qgis.core
)
I've seen Using processing using other output (result from another algorithm) as input and Import error for qgis.core when running OSGeo4w shell script but I couldn't figure out a working solution to my problem so far.
Answer
Although this is not what I wanted to do, the easiest way to do this is to use the Model
.
This way it is easy to plug the output from one Algorithm to the input of another one.
No comments:
Post a Comment