Hi Frank,

On Fri, 29 Jun 2018 at 09:35, Frank Broniewski <ha...@frankbroniewski.com>
wrote:

> Anyway, my testing-algorithm-script is still not working. It runs through,
> but I do not get the expected result loaded into the layer tree. I suppose
> it runs through - the  output from the 'qgis:pointsalonglines' is a
> QgsVectorLayer - but after finishing I get nuthink back.
>
>
I had a similar problem. I think it's because the template defines the
output as a feature sink, so you assume you have to use the same. I think
if you change your definition from:

self.addParameter(
            QgsProcessingParameterFeatureSink(
                self.OUTPUT,
                self.tr('Center line')
            )
        )


to:

self.addParameter(
            QgsProcessingParameterVectorDestination(
                self.OUTPUT,
                self.tr('Center line')
            )
        )


and then in processAlgorithm you need to add output as a layer you can work
with:

output = self.parameterAsOutputLayer(parameters,self.OUTPUT,context)


Finally, in your `params` dict, change the value for OUTPUT from `memory:`
to `output`.

The new syntax is more complicated than it used to be, and it takes some
time to wrap your head around it. I do find that it gets easier once you've
got a couple of scripts under your belt.

Rudi
_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to