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

Tim Sutton tim at kartoza.com
Wed Aug 7 16:50:13 PDT 2019


Hi




> On 7 Aug 2019, at 23:41, Nyall Dawson <nyall.dawson at gmail.com> wrote:
> 
> 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.

Hmm I had been trying this the last couple of days with no luck……but now I got it to work! Yay! I’m sure not enough people tell you this, but the report stuff is awesome! Thanks!


We don’t have anything equivalent of the layout atlas’s filter features right? Would be nice to be able to filter report group records by some criteria.

> 
>> 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…

Thanks for the feedback above - I will go with the cheating approach of using rule based renderers for filtering data for now.  But nice to know you have a plan in mind for some crowdfunding or grant work in the future :-P

Regards

Tim


> 
> 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.
>> 

—









Tim Sutton

Co-founder: Kartoza
Ex Project chair: QGIS.org

Visit http://kartoza.com <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 <https://calendly.com/timlinux> to make finding time easy.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20190808/df8f9d49/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: KartozaNewLogoThumbnail.jpg
Type: image/jpeg
Size: 6122 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20190808/df8f9d49/attachment-0001.jpg>


More information about the QGIS-Developer mailing list