<div dir="ltr"><div>Hi Anita,</div><div><br></div><div>Thanks very much for this. I am still lost though. If I replace the sink and add your code I don't get an output in the dialog box - it needs to be a parameter for that to happen right?</div><div><br></div><div>I found this <a href="https://gis.stackexchange.com/questions/282773/writing-a-python-processing-script-with-qgis-3-0">https://gis.stackexchange.com/questions/282773/writing-a-python-processing-script-with-qgis-3-0</a></div><div>which lead me to this</div><div><a href="https://github.com/qgis/QGIS/blob/master/doc/porting_processing.dox">https://github.com/qgis/QGIS/blob/master/doc/porting_processing.dox</a></div><div><br></div><div>Which is recommending "Best practice in 3.x Processing algorithms is to use "feature sinks" instead of vector layer outputs"</div><div><br></div><div><br></div><div>Kind Regards</div><div>Andrew<br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Aug 9, 2018 at 2:23 PM Anita Graser <<a href="mailto:anitagraser@gmx.at" target="_blank">anitagraser@gmx.at</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Andrew,</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Aug 9, 2018 at 2:57 PM Andrew C <<a href="mailto:andrew.cutts@gmail.com" target="_blank">andrew.cutts@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>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.<br></div></div></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">I think you'd need an output layer instead of a feature sink. Have a look at <a href="https://github.com/qgis/QGIS/blob/master/python/plugins/processing/algs/qgis/PostGISExecuteAndLoadSQL.py" target="_blank">https://github.com/qgis/QGIS/blob/master/python/plugins/processing/algs/qgis/PostGISExecuteAndLoadSQL.py</a></div><br>self.addOutput(QgsProcessingOutputVectorLayer(<br><div class="gmail_default" style="font-size:small;display:inline">   </div>self.OUTPUT,<br><div class="gmail_default" style="font-size:small;display:inline">   </div><a href="http://self.tr" target="_blank">self.tr</a>("Output layer"),<br><div class="gmail_default" style="font-size:small;display:inline">   </div>QgsProcessing.TypeVectorAnyGeometry))<div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Regards,</div></div><div class="gmail_default" style="font-size:small">Anita</div><div class="gmail_default" style="font-size:small"><br></div></div></div>
</blockquote></div>