[QGIS-Developer] Expressions with aggregate in PyQGIS

Anita Graser anitagraser at gmx.at
Mon May 20 01:08:08 PDT 2019


On Mon, May 20, 2019 at 9:41 AM matteo <matteo.ghetta at gmail.com> wrote:

> Hi Anita,
>
> you hit a good missing topic in the pyqgis documentation. I see very
> often people asking for support on Expressions and their use in pyqgis.
>
> What do you think to add the example also in the pyqgis documentation
> directly? Since the last meeting we also have the test framework ready
> to go [0] that helps a lot to have strong code snippet.
>
> Having all the pieces in one box is the best solution IMHO
>

I agree. I'm only hesitant since I don't have a doc writing setup on my
Windows machine yet and the instructions seem to be Linux only.

I'll see what I can do. Otherwise, I'll get back to you with the content
and ask for help integrating it.

Regards,
Anita




>
> Cheers and thanks
>
> Matteo
>
> [0]
>
> https://docs.qgis.org/testing/en/docs/documentation_guidelines/cookbook_guidelines.html
>
> On 5/20/19 9:01 AM, Anita Graser wrote:
> >
> >
> > On Mon, May 20, 2019 at 2:37 AM Nyall Dawson <nyall.dawson at gmail.com
> > <mailto:nyall.dawson at gmail.com>> wrote:
> >
> >     On Mon, 20 May 2019 at 01:21, Anita Graser <anitagraser at gmx.at
> >     <mailto:anitagraser at gmx.at>> wrote:
> >     > I'd like to add an example of an aggregate expression to my recent
> >     PyQGIS 101 tutorial on expressions [0]. I got expressions for
> >     individual features working but cannot figure out how to set the
> >     context for aggregate expressions correctly.
> >     > As far as I can tell, the PyQGIS Cookbook doesn't contain any
> >     information on this either [1].
> >
> >     You aren't correctly constructing your expression context:
> >     ...
> >
> >     A documentation update covering this would be most welcome ;)
> >
> >
> > Thank you Nyall, that's really helpful! The expression system is awesome
> > and powerful but I don't think anyone could guess how to use it
> > correctly in PyQGIS.
> >
> > I'll write it up into a tutorial and the documentation team is always
> > welcome to reuse the content in the official documentation.
> >
> > Regards,
> > Anita
> >
> >
> >
> > _______________________________________________
> > 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
> >
> _______________________________________________
> 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/20190520/80ede45b/attachment.html>


More information about the QGIS-Developer mailing list