[QGIS-Developer] How to create a simple processing script in QGIS 3.x, eg just a buffer

Anita Graser anitagraser at gmx.at
Thu Aug 9 06:23:07 PDT 2018


Hi Andrew,

On Thu, Aug 9, 2018 at 2:57 PM Andrew C <andrew.cutts at gmail.com> wrote:

> I am not clear on how QgsFeatureSinkis working, perhaps that is why I am
> not getting the buffered layer? Normally in a script I could try printing
> variables I cannot see where these are printed either when I tested.
>

I think you'd need an output layer instead of a feature sink. Have a look
at
https://github.com/qgis/QGIS/blob/master/python/plugins/processing/algs/qgis/PostGISExecuteAndLoadSQL.py

self.addOutput(QgsProcessingOutputVectorLayer(

self.OUTPUT,

self.tr("Output layer"),

QgsProcessing.TypeVectorAnyGeometry))

Regards,
Anita
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180809/b879ae87/attachment.html>


More information about the QGIS-Developer mailing list