I have a set of 700 points within the footprint of a 16-storey building. The points have a building floor attribute (e.g. "Floor" = 12), and another attribute relevant to my presentation (call it "AttType" = 'A', 'B', 'C'...).
I want to generate a map for each floor which should do two things:
- display only the points on that floor
- show accurate point counts per AttType in the legend
I have managed to do 1 by creating 16 map composers and naming the map ID "Level 1", "Level 2", etc., then styling the point layer with the rule
@map_id = concat('Level ',"Floor") so that only points of the appropriate floor show up.
However, because of this non-exclusive rule-based styling, 2 doesn't work: the feature counts in the legend show
 for each AttType.
I can think of two workarounds, but neither is satisfactory:
- One is to have 16 copies of the point layer, each filtered to a specific floor and named "Level 1 Points", etc., then setting up each map composer with a map ID as I already do ("Level 1"), only with a layer filter using a data-defined override (e.g.,
concat(@map_id,' Points')|'Other vector layer'|'Background raster')
However, having 16 point layers in the project makes it quite sluggish, and having to update any style changes in one layer across all 16 layers is something I'd really rather avoid.
The other is to manually generate feature counts in text boxes using
aggregate('layer name','count',"AttType","AttType" = 'A' AND "Floor" = 1)and put them in the appropriate place next to each AttType on the legend.
This is even more time-consuming, but does avoid the problems of the latter workaround.
Is there any other way to solve this issue?
The Map Composer legend seems hard to customise.
My understanding is that I cannot use the Atlas function as the points all fall within the same XY plane (=building footprint).