On Fri, 29 Jun 2018 at 17:35, Frank Broniewski
<[email protected]> wrote:

>     def processAlgorithm(self, parameters, context, feedback):
>         # qgis:pointsalonglines
>         params = {
>             'INPUT': parameters[self.INPUT],
>             'DISTANCE': parameters[self.DISTANCE],
>             'START_OFFSET': 0,
>             'END_OFFSET': 0,
>             'OUTPUT': 'memory:'
>         }
>         points = processing.run(
>             'qgis:pointsalonglines',
>             params, context=context, feedback=feedback
>         )['OUTPUT']
>
>         return {self.OUTPUT: points}
>

Try:

     def processAlgorithm(self, parameters, context, feedback):
         # qgis:pointsalonglines
         params = {
             'INPUT': parameters[self.INPUT],
             'DISTANCE': parameters[self.DISTANCE],
             'START_OFFSET': 0,
             'END_OFFSET': 0,
             'OUTPUT': 'memory:'
         }
         points = processing.run(
             'qgis:pointsalonglines',
             params, context=context, feedback=feedback
         )['OUTPUT']

        # store result layer in context - this prevents it being
deleted and cleaned up
        # when processAlgorithm finishes
        context.temporaryLayerStore().addMapLayer(points)

         # return the layer ID in the results dictionary - processing
will automatically retrieve the corresponding
         # layer from the context when required
         return {self.OUTPUT: points.id()}


Nyall
_______________________________________________
Qgis-user mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to