I have one vector layer of multiple polylines that intersect each other in QGIS.
What I want to do: calculate all intersections angles (2-ray, 3-ray, 4-ray and 5-ray types) in this vector layer.
What I did: I used the v.clean tool to split all polylines at the intersections.
I created a buffer at every intersection and clipped out the polylines. Then I assigned a unique “buffer ID” for the related intersections located within each buffer. The orientation of each line at an intersection was calculated with: degrees(azimuth(start_point($geometry), end_point($geometry)))
I have come this far. I think next step is to subtract the orientation value of a line feature from it’s adjacent line feature (e.g. clockwise from 0°) and so on until all intersection angles are calculated, then going on with the next buffer.
The problem: As you can see in the Screenshot and a section of the attribute table, the displayed IDs are not always in a clockwise (or counterclockwise) order. So, I don’t know how tell E.g. Excel or QGIS which value to subtract from which one.
Sorting the values by “Orientation” also doesn’t work always since e.g. ID1788 has 135° (should be 315°) but ID1790 has 208° Orientation of 227° corresponds to 47° (227°-180°)
E.g. ID1790 (208°) - ID1788(135°) = 73° (wrong intersection angle)
correction: ID1790 (208°) - ID1788(135°**+180**]) = (-)107°
I hope I was able to explain my problem clearly and maybe you have a solution approach for me. I also read this point-based approach, but I don’t know if it helps for my problem. (Calculating angle using three WGS 84 points and Angle at intersection point from two Lines )