[Qgis-user] How to make diagonals

Sebastian Gutwein bas at rdgland.com
Mon Feb 7 15:53:10 PST 2022


This stack exchange answer seems like it would work for you.
https://gis.stackexchange.com/a/365955

On Fri, Feb 4, 2022 at 11:33 AM chris hermansen <clhermansen at gmail.com>
wrote:

> Might generalizing the lines (Poiker Douglas or similar) yield four line
> rectangles?
>
> On Thu, Feb 3, 2022, 23:44 Etienne Trimaille <etienne.trimaille at gmail.com>
> wrote:
>
>> 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 <dario955i at 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 at 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 at 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 at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
-- 
Sent from a phone. Amazing! But possibly garbled. Sebastian Gutwein
Regenerative Design Group 1 Chevalier Ave Greenfield MA Bas at rdgland.com
(631) 241-1018
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20220207/f2ebe729/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/20220207/f2ebe729/attachment.png>


More information about the Qgis-user mailing list