I would like to build a rectangle (shape or symbol) with a given size (height/length) from the attribute-table.
In detail:
I build a Atlas of maps with alternating sizes, like 145×129 or 165×129. The size of every feature is written in the attribute table of the coverage-layer. So far so good: every map got his own defined size using data defined override for map length and height.
But now I would like the bounding boxes of the atlas-maps to be shown as overlays on the map in my canvas. (Like you can do with the overlay-function in the print composer)
The best approach seemed to be to use the geometry-generator and build a polygon around the centroid of the feature. I already started a post months ago: Using QGIS Geometry Generator to get rectangle from point?
With the result, that it is not possible because the "Geometry generator does not support calculations inside WKT".
I still have that problem to solve. Do anyone know a other approach?
Best Answer
@iant was faster but this is my version with PostGIS.
This one works with points and fixed offsets "1" to each direction.
This is using centroids and work with any geometry type:
If your offsets are stored into attributes "offset_x" and "offset_y" use this: