[Qgis-user] How to make diagonals

Dario C dario955i at gmail.com
Thu Feb 3 14:28:39 PST 2022


Hi,
I have several rectangles (almost squared) and I'd like to represent
their diagonals.

I started to do with geometry generator with:
make_line(point_n($geometry,1),point_n($geometry,4))
and
make_line(point_n($geometry,2),point_n($geometry,5))

Unfortunately, even if they look rectangular, actually they have more then
4 points and, moreover, points do not always have the same order.

here below an example:
[image: image.png]

Is there any expression in order to pick the two longest segments
connecting all the points of the geometry?


Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20220203/c462368e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 9834 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20220203/c462368e/attachment.png>


More information about the Qgis-user mailing list