<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">etienne.trimaille@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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" target="_blank" rel="noreferrer">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" target="_blank" rel="noreferrer">dario955i@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><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="margin-right:0px" width="654" height="245"></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" target="_blank" rel="noreferrer">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" rel="noreferrer">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>