I am not much of a programmer, but I have been using QGIS for about a year now to do fibre planning. I use the Atlas print to PDF feature to print the suburb plans with a block overlay layer to print individual blocks of a suburb. Around all the blocks there lines representing fibre lines, and on these lines there are points representing access points. In this week I started using rule based symbology and labelling where I would use the following code in each layer to turn off all layers except the layer that is active on the atlas:

within($geometry, @atlas_geometry )=1

This works great if the polygon covers everything in the block in question, including the lines and points around the block.

My blocks where generated by a Model in QGIS that was written by someone else, and only covers the erven within the block, and not the surrounding lines and points, which I need to print as well. So this is what I am getting in my print layout at the moment. Only the addresses and the block's label:

enter image description here

This is what I need:

enter image description here

All Addresses are showing, including the erven lines, the lines around the block and the point around the block with their labels.

The problem is that all 128 blocks I need to export to PDF as individual pages, are all too small. I need to slightly enlarge each polygon to include the points and lines around it.

I have tried affine transform, buffer vectors and transforms vector layer without success. I read that the grass v.transform might be able to perform this function, but it gives an error when I run it:

enter image description here

1 Answer 1


Modifying your code to within($geometry, buffer(@atlas_geometry,XX,25) )=1 should work, where XX is the distance you might need to cover.

  • Thanks, in what measure would the XX be? points, meters. I tried the following: within($geometry, buffer(@atlas_geometry,10,25) )=1 But now it just displays permanently, regardless if it is in focus on the Atlas. Mar 28, 2021 at 15:10
  • Which CRS is the layer covering your atlas using @WernerLeRoux? Since buffer uses CRS-units, a layer using degree will be buffered in degree.
    – Erik
    Mar 29, 2021 at 6:51
  • Hi, CRS is EPSG:4326 - WGS 84 - Geographic Mar 29, 2021 at 8:19
  • Seems to be Degrees. But does not matter what I make the values, it just displays permanently, regardless if it is in focus on the atlas. Mar 29, 2021 at 8:22
  • Yeah, because you're buffering your polygons using degree. Reproject your atlas-layer to a m-based CRS, then my solution will work properly.
    – Erik
    Mar 29, 2021 at 9:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.