[QGIS-Developer] Example script for Processing in QGIS 3

G. Allegri giohappy at gmail.com
Tue Jan 23 03:14:00 PST 2018


Hi Nyall,
scripts seem way more complex then before. I guess it is the simplest way
that could be found to accomodate Processing scripts to the refactored code.
Some questions from the previous scripts examples:

1) Is automatic output / sink parameter conversion impossible to obtain? In
[1] self.parameterAsSink is used, and it's not very clear to me what the
second method output (Biggest_parts) represent. Input / source (Polygons)
is used directly instead, as it was in QGIS 2.x

2) There are some global vars that appear to be automagically injected by
the script execution context, like "parameters" and "context". Are they
documented somewhere?

3) The test scripts use different approaches. Centroids.py use source /
sink, while the others two define vector / vectorDestination. Are they
supposed to work?

Thanks!
Giovanni

[1]
https://github.com/qgis/QGIS/blob/master/python/plugins/processing/algs/qgis/scripts/Keep_n_biggest_parts.py#L19

2018-01-23 11:59 GMT+01:00 Nyall Dawson <nyall.dawson at gmail.com>:

> On 23 January 2018 at 18:28, Alexander Bruy <alexander.bruy at gmail.com>
> wrote:
> > There are some scripts in the Processing tests
> > https://github.com/qgis/QGIS/tree/master/python/plugins/
> processing/tests/testdata/scripts
> >
>
> There's also https://github.com/qgis/QGIS/blob/master/python/plugins/
> processing/algs/qgis/scripts/Keep_n_biggest_parts.py
> , although I'd ideally like to port this script to a proper algorithm
> before release.
>
> Nyall
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180123/8e653dc2/attachment-0001.html>


More information about the QGIS-Developer mailing list