On 26 March 2018 at 14:40, Nyall Dawson <[email protected]> wrote: > On 24 March 2018 at 10:22, Nyall Dawson <[email protected]> wrote: >> On 23 March 2018 at 22:47, Andreas Neumann <[email protected]> wrote: >>> Hi, >>> >>> I noticed a big problem in the rule based renderer when PostgreSQL layers >>> are involved and the rule contains @atlas_featureid. >>> >>> As an example, I use this rule: >>> >>> $id != @atlas_featureid >>> >>> When I click on the "Test" button I get "Filter returned xxxx features". So >>> far so good. But the bad thing: nothing is drawn on the canvas! >>> >>> Could it be that the expression compiler tries to forward this query, but >>> PostgreSQL knows nothing about @atlas_featurid ? >>> >>> Can someone confirm that this really is the case before I file an issues >>> report? >> >> Confirmed - think I can see an easy fix for this. > > I take that back - I'd made a mistake. Can you open a ticket and share > a project demonstrating this? >
For future reference, this is fixed now. It was caused by the canvas initially having the @atlas_featureid variable having a null value (until an atlas is opened), so the expression was effectively $id != NULL (which is always false). In contrast the Test button would set a @atlas_featureid to 0 if a real feature id wasn't available - so it was reporting matching features. Now the canvas uses the same approach as the test button and defaults @atlas_featureid to 0 if it's not yet set. Nyall _______________________________________________ QGIS-Developer mailing list [email protected] List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
