[QGIS-Developer] Filtering features in a layer by a report group

Nyall Dawson nyall.dawson at gmail.com
Wed Aug 7 15:41:04 PDT 2019


On Thu, 8 Aug 2019 at 01:37, Tim Sutton <tim at kartoza.com> wrote:

> Ok but is there a way to access the equivalent of @atlas_feature_id in my style rules when running the report so I can hide vegetation points that don’t match the plant name I am iterating over?

Yes - just use it, exactly like you do with atlases :)

Because there's currently no report preview mode, you can't see the
effects of this on the canvas or in the layout designer. But it WILL
work correctly at export time.

> Yup I am aware of the provider part but shouldn’t one still be able to interpolate QGIS expressions (or at least variables) into the filter expression? I am thinking the equivalent here of doing
>
> Select * from layer_foo where name=“@some_name”

That would work in some cases, but variables can also be QGIS specific
values like geometry objects. So then every provider would need logic
to convert these to something which works for that backend. I suspect
this is a dangerous path to go down, since we'd constantly be trying
to close corner cases where a particular filter isn't working
correctly for a particular backend.

I think I'd prefer a mode where you could choose from either filtering
using the backend syntax OR qgis expressions. Given that we now have
good support for "compiling" QGIS expressions back to the closest
possible provider native equivalent, and that all providers handle
this, in most cases there should be very minimal loss of performance.
And the benefit would be that ALL QGIS expressions would be guaranteed
to work correctly regardless of the provider backend...

Nyall



>
> Which gets replaced with the actual name each time a read request  is made.
>
>
> Thanks!
>
> Regards
>
> Tim
>
>
>
> See https://github.com/qgis/QGIS/issues/24932
>
> Nyall
>
>
>
>
> Thanks!
>
> Regards
>
> Tim
>>
>
>
>
>
>
>
>
> Tim Sutton
>
> Co-founder: Kartoza
> Ex Project chair: QGIS.org
>
> Visit http://kartoza.com to find out about open source:
>
> Desktop GIS programming services
> Geospatial web development
> GIS Training
> Consulting Services
>
> Skype: timlinux
> IRC: timlinux on #qgis at freenode.net
>
> I'd love to connect. Here's my calendar link to make finding time easy.
>
> _______________________________________________
> 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
>
>
>>
>
>
>
>
>
>
>
> Tim Sutton
>
> Co-founder: Kartoza
> Ex Project chair: QGIS.org
>
> Visit http://kartoza.com to find out about open source:
>
> Desktop GIS programming services
> Geospatial web development
> GIS Training
> Consulting Services
>
> Skype: timlinux
> IRC: timlinux on #qgis at freenode.net
>
> I'd love to connect. Here's my calendar link to make finding time easy.
>


More information about the QGIS-Developer mailing list