Is there a way on Atlas to put a Margin around feature but also use Predefined scales?

Geographic Information Systems Asked on May 8, 2021

In QGIS, how can I put a margin around a feature but also use predefined scales in Atlas? Like an in-between of the two options. I have a feature that fits in the map but as you can see in the image it almost reach the edges leaving some annotation out of the viewmap, so I would like QGIS to use a smaller scale to better accommodate the drawing.

enter image description here

I need it to be the same coverage layer with the features – not another layer with a buffer – due to the fact that I have a symbology that depends on it, like the expression that I use to show only the features that touch the atlas feature in more than two vertices.

Tried to create a buffer with "Geometry Generator" around the feature thinking the program would understand that I also want it to appear and so shrink the drawing, but it didn’t work. Is there a way to do that?

One Answer

One option you could do, would be to add a few pre-defined scales to your atlas and change them dynamically based on the size of your atlas feature. So if you go to your scale and insert an expression: enter image description here

Something along these lines:

area( @atlas_geometry ) <5
THEN 50000
area( @atlas_geometry ) <10
THEN 80000
ELSE 100000

This will read the size of your feature area and adjust the scale based on that. Of course you will have to change those limits according to your own data. You could also add more scales or use a line length or something else as the geometrical feature to define the scales.

Answered by tjukanov on May 8, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP