I am working on a series of maps in QGIS. I am creating an atlas, not generated on a grid of regular size, but instead based on polygon features of variable size. Everything working well so far, sometimes using answers provided in this community. The only questions I did not find an existing answer about, concerns fine-tuned labelling of overlaying layers. I will be taking here a simplified example using country polygon layers, and examples labels highlighted in yellow (country names).
Due to the varying size of polygons defining atlas pages extents, both of the following case will happen:
In case A, some page extent intersects the border of 2 countries. In case B, page extent is entirely contained within one country.
I would like the country layer to be labelled in case B only, to avoid a lone country label getting placed at the center of the canvas.
Instinctively, I would be looking to advanced labelling rules and try to build a custom label, trying to state the following rule: label layer only if more than 1 polygon is visible in canvas extent.
- Would that logic be valid and how should I do it?
- Can I combine this logic with Atlas generation in Layout, or would it work only with individual map creation?
I am currently trying along the lines proposed at Selecting features visible in map extent using QGIS