[Qgis-user] QGIS 3 Processing question

Frank Broniewski hallo at frankbroniewski.com
Wed Jul 4 01:43:43 PDT 2018


Hi Nyall,

this works like a charm! Here's what I needed it for: Create polygon center lines in QGIS [1]. My script for processing is still quite rough around the edges and everywhere else and needs some testing, but I am getting results, thanks to you!

Many thanks,
Frank


[1] GIT https://github.com/frankbroniewski/polygoncenterline/blob/master/PolygonCenterline.py

-----Ursprüngliche Nachricht-----
Von: Nyall Dawson <nyall.dawson at gmail.com> 
Gesendet: Dienstag, 3. Juli 2018 11:55
An: Frank Broniewski <hallo at frankbroniewski.com>
Cc: qgis-user <qgis-user at lists.osgeo.org>
Betreff: Re: [Qgis-user] QGIS 3 Processing question

> Nyall's tip with the temporary layer store just runs through nicely, but nothing gets added to the layer pane after the script finished.

Sorry - missed something here. Because you're directly using the output from the child algorithm as your algorithm's final output, you should also pass the OUTPUT parameter value direct to the child algorithm. So in

>
>      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:'
>          }

 'OUTPUT': 'memory:'

should be

 'OUTPUT': parameters[self.OUTPUT]

Nyall
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5488 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20180704/398077b0/attachment.bin>


More information about the Qgis-user mailing list