Re: [Qgis-user] How to make diagonals

2022-02-08 Thread Dario C
thank you. I'm gonna try. It looks I have just to select my layer and then paste the code into python editor. isn't it? If so, do you have an idea how to choose also the second longest? this is what I have in the code: longest_line = max(all_lines, key=lambda x: x.length()) thanks again Il

Re: [Qgis-user] How to make diagonals

2022-02-07 Thread Sebastian Gutwein
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 wrote: > Might generalizing the lines (Poiker Douglas or similar) yield four line > rectangles? > > On Thu, Feb 3, 2022, 23:44 Etienne Trimaille >

Re: [Qgis-user] How to make diagonals

2022-02-04 Thread chris hermansen
Might generalizing the lines (Poiker Douglas or similar) yield four line rectangles? On Thu, Feb 3, 2022, 23:44 Etienne Trimaille 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 >

Re: [Qgis-user] How to make diagonals

2022-02-03 Thread Etienne Trimaille
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

[Qgis-user] How to make diagonals

2022-02-03 Thread Dario C
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, actua