[Qgis-developer] Getting access to atlas record
Andreas Neumann
a.neumann at carto.net
Thu Jun 19 22:07:56 PDT 2014
Hi Nyall,
Cool that you had a look at this already. It would open up a lot of
possibilities.
Along the same lines I noticed that the table in print composer is not
updated correctly when iterating in the atlas preview mode (don't know
if it works when generating the pdfs).
My usage scenario was that I could filter a linked attribute table based
on a spatial query based on the atlas coverage table. E.g. my atlas
coverage table was a polygon layer with communities and my other table
was a point-layer with school and kindergardens. In the atlas I wanted
to filter the table with the schools and kindergardens with the
expression "within($geometry,$atlasgeometry)". The filter works fine,
but the table does not update when iterating.
I will open a feature request for the access to $atlasfeature and a
bug-report for the table update issue. Maybe, if we ever ship a bugfix
release, the table update issue could go in there. It would be very nice
if this bug were resolved.
Again - I really did not have enough time in one month to test all the
functionalities (old and new one). Impossible at least for me.
Andreas
> Hi Andreas,
>
> I've been working on this. I nearly had it ready for 2.4, but in the
> end I wasn't comfortable pushing it late in the development cycle.
> What I've done is:
>
> - Add an "$atlasfeature" variable, which returns the current atlas feature
> - Add a "$currentfeature" variable, which returns the current feature
> which is being evaluated (unfortunately $feature is already used for
> the current atlas feature NUMBER, which is an issue for a separate
> email!)
> - Add an "attribute( feature, column )" function, which returns the
> value stored in the specified column for a given feature
>
> This allows you to do an expression like:
> "area_code" = attribute($atlasfeature, 'area_code')
>
> Or, you can do neat things like label a column using an expression to
> choose the column name!..
> attribute( $currentfeature, "label_column" )
>
> Hopefully I can push this soon after master is unfrozen.
>
> Nyall
>
More information about the Qgis-developer
mailing list