<div dir="auto">This stack exchange answer seems like it would work for you. <div><a href="https://gis.stackexchange.com/a/365955">https://gis.stackexchange.com/a/365955</a></div></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 4, 2022 at 11:33 AM chris hermansen <<a href="mailto:clhermansen@gmail.com">clhermansen@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="auto">Might generalizing the lines (Poiker Douglas or similar) yield four line rectangles?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 3, 2022, 23:44 Etienne Trimaille <<a href="mailto:etienne.trimaille@gmail.com" target="_blank">etienne.trimaille@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="ltr"><div>Maybe "oriented_bbox" to get first a proper rectangle ?<br></div><div><a href="https://docs.qgis.org/testing/en/docs/user_manual/expressions/functions_list.html#oriented-bbox" rel="noreferrer" target="_blank">https://docs.qgis.org/testing/en/docs/user_manual/expressions/functions_list.html#oriented-bbox</a></div><div><br></div><div>But then, you might have some tiny leftover. It depends if you care or not.</div><div><br></div><div>Otherwise, you need to use the angle at each points.</div><div><br></div><div>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.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le jeu. 3 févr. 2022 à 23:29, Dario C <<a href="mailto:dario955i@gmail.com" rel="noreferrer" target="_blank">dario955i@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="ltr">Hi,<br><div>I have several rectangles (almost squared) and I'd like to represent their diagonals.<br><br>I started to do with geometry generator with:</div><div>make_line(point_n($geometry,1),point_n($geometry,4))<br></div><div>and</div><div>make_line(point_n($geometry,2),point_n($geometry,5))<br></div><div><br></div><div>Unfortunately, even if they look rectangular, actually they have more then 4 points and, moreover, points do not always have the same order.</div><div><br></div><div><div>here below an example:</div><div><img src="cid:ii_kz7jsrjs0" alt="image.png" style="width:667px;max-width:100%"></div></div><div><br></div><div>Is there any expression in order to pick the two longest segments connecting all the points of the geometry?</div><div><br></div><div><br></div><div>Thanks</div></div>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" rel="noreferrer" target="_blank">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
</blockquote></div>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" rel="noreferrer" target="_blank">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
</blockquote></div>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
</blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Sent from a phone. Amazing! But possibly garbled.  

Sebastian Gutwein
Regenerative Design Group
1 Chevalier Ave Greenfield MA
<a href="mailto:Bas@rdgland.com">Bas@rdgland.com</a> 
(631) 241-1018</div>