In QGIS 3.16 I have prepared an atlas of a city, based on a UTM 500×500 m grid. When displaying each cell in the atlas, I want its label to have a larger font size than its neighbours:
In the string builder for the font size
I've built the following code, but it doesn't work
if(within($geometry, @atlas_geometry), 12, 7)
What's wrong?
Best Answer
Use rule based labeling and set two rules:
within ($geometry, @atlas_geometry )
for the features inside the atlas geometrynot within ($geometry, @atlas_geometry )
for all othersSee the settings on the right. Highlighted in red the current atlas feature:![enter image description here](https://i.stack.imgur.com/lMTho.png)