Timeline for Calculating interior angles of polygons or lines in QGIS
Current License: CC BY-SA 4.0
19 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
S Jan 23 at 10:21 | history | suggested | Romarinho | CC BY-SA 4.0 |
In B), I changed the condition inside the azimuth2 to if(@vertex+2>num_geometries( nodes_to_points( $geometry,true))+1,2,@vertex+2) (I added a +1). In the original post the before last @azimuth2 would always be wrong due to the fact that it would take the point 2 of the polygon instead of the last
|
Jan 23 at 9:51 | review | Suggested edits | |||
S Jan 23 at 10:21 | |||||
Sep 23, 2021 at 15:27 | comment | added | Stu Smith | I use your Steps C5 and 6. Here's my flow: a) digitize single squarish polygon - as expected there are four interior angles, b) Polygons to Lines tool, c) Explode lines tool - the output, as expected, has four lines, d) use your Step C5 to calculate field inner_angle in the exploded lines layer. But angles are only calculated for the first three records; the fourth record is NULL. Thus, there is no angle produced for the vertex at the end of the fourth line (which coincides with the first vertex). I think that this is the source of the problem. | |
Sep 23, 2021 at 15:02 | comment | added | Babel | When I use the first expression under "B. Get list of all the angles of a line or polygon", this is what I get: 4 angle values for a polygon with 4 vertices, see: i.sstatic.net/6lq79.png | |
Sep 23, 2021 at 14:54 | comment | added | Babel | OK, which one of the expressions did you use? | |
Sep 23, 2021 at 14:52 | comment | added | Stu Smith | You're correct about #1; I missed the part in your answer about counter-clockwise (my apologies). But regarding #2, imagine an initial polygons that is roughly square; it therefore has four inner angles. What I'm seeing is that only the first three inner angles are symbolized. | |
Sep 22, 2021 at 13:36 | comment | added | Babel | I wrote the expression a few months before, so I'm not quite sure, but I guess 1. has to do with the direction the polygons are drawn. As stated, this solution is valid for "interior angle if their outer ring is drawn counter-clockweise (inside of the polygon is at left hand)". If counter-clockwise, simply calculate 360-[my expression]. 2. First and last vertex of a polygon are the same point and after the last vertex, there is no next vertex to draw a line - thus no angle. | |
Sep 21, 2021 at 3:54 | comment | added | Stu Smith | When I try your process using steps C5 & C6 there are two problems: 1. The angles calculated and displayed are the outer angles, and 2. The last record results in a NULL value for an angle. Thoughts? | |
Jul 15, 2021 at 20:12 | vote | accept | Babel | ||
May 24, 2021 at 16:15 | history | edited | Babel | CC BY-SA 4.0 |
added 75 characters in body
|
May 24, 2021 at 15:25 | history | edited | Babel | CC BY-SA 4.0 |
added 1972 characters in body
|
May 24, 2021 at 15:14 | history | edited | Babel | CC BY-SA 4.0 |
added 1972 characters in body
|
May 24, 2021 at 13:44 | history | edited | Babel | CC BY-SA 4.0 |
added 585 characters in body
|
May 24, 2021 at 10:40 | history | edited | Babel | CC BY-SA 4.0 |
added 455 characters in body
|
May 23, 2021 at 21:30 | history | edited | Babel | CC BY-SA 4.0 |
added 218 characters in body
|
May 23, 2021 at 20:31 | history | edited | Babel | CC BY-SA 4.0 |
added 3 characters in body
|
May 23, 2021 at 20:25 | history | edited | Babel | CC BY-SA 4.0 |
added 3 characters in body
|
May 23, 2021 at 20:19 | history | edited | Babel | CC BY-SA 4.0 |
added 3 characters in body
|
May 23, 2021 at 20:12 | history | answered | Babel | CC BY-SA 4.0 |