Maybe "oriented_bbox" to get first a proper rectangle ? https://docs.qgis.org/testing/en/docs/user_manual/expressions/functions_list.html#oriented-bbox
But then, you might have some tiny leftover. It depends if you care or not. Otherwise, you need to use the angle at each points. I thought there is the longest line possible within a polygon, but I can't find it. I did it manually a few years ago. Le jeu. 3 févr. 2022 à 23:29, Dario C <dario9...@gmail.com> a écrit : > 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 > _______________________________________________ > Qgis-user mailing list > Qgis-user@lists.osgeo.org > List info: https://lists.osgeo.org/mailman/listinfo/qgis-user > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user >
_______________________________________________ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user