I would like to create a set of rule based label styles for a subset of points inside a particular polygon, with the ability to still quickly show/hide the labels using the button
The situation: I have a polygon layer made up of several protected areas. Inside each protected area I have points (for more labels than I want to show) for things like mountains and islands. The project is going for review by committee and I don't know which features the committee will want so I have to guess when I make the draft and then I will need to go back over the maps to make corrections.
I would like to only show point labels inside 'Protected Area A', but not all the labels because there are too many, and style the point labels for mountains in different colours (aka: only label some mountains within Protected Area A).
- The 'within' code below gets me part of the way, but I can't figure out how to add in the type of point e.g.: mountain, and I can't figure out how to show labels in only one of the polygons instead of all of them.
(within($geometry, aggregate('ProtectedArea', 'collect', $geometry)) = 1))
So far this seems like my best option, I'd just need to make separate polygon layers for each protected area. - I tried using the 'within' polygon code in the label renderer, but it stops the show/hide button from working
- Someone suggested maybe the
overlay_intersects()
might be a direction to go but I am not familiar with the expression. - I can create a new field for show/hide in the attribute table, but it's so slow doing the manual data entry
- I can split the points up into different category layers but that gets cumbersome for the editing because there are too many categories, polygons, and scales that I am working at.