As you can see in the picture, is there any way to calculate angle of a river cross section profile from right side of the river profile with respect to the flow direction till the north axes in QGIS
1 Answers
Thanks for updating your screenshot; it helped!
The following is one way to solve your problem. To help, I created a hypothetical layer, named stream, shown below. Even though it twists and turns, you can see that it has just one record. Because it only has one record, it is not possible to determine the angle value for each segment. Note also that I digitized the stream in one direction, as indicated by the ending arrow. It is critical that this direction is always downstream!
Creating your crossing angles took several steps. First, I created a new layer, stream_exploded, where each stream segment has its own record, using the Processing > Toolbox > Vector Geometry > Explode Lines tool. The input layer was stream. The output is shown below. Note that there are now eight records, one for each stream segment. This means that the angle for each stream segment can now be calculated.
Next, I edited the stream_exploded attribute table by adding a new integer field named stream_angle. Using the Field Calculator, I calculated stream_angle = line_interpolate_angle($geometry,0). This value represents the angle of each stream segment from north, as it flows downstream, and is represented by the first number in each label.
Now that the downstream angle is known, I created a new integer field named cross_angle. It represents the river profile angle, perpendicular to stream_angle, with respect to north. I determined cross_angle using a series of attribute selections followed by the Field Calculator, as follows:
1a. Attribute selection:
("stream_angle" > 0 AND "stream_angle" < 90) OR ("stream_angle" > 90 AND "stream_angle" < 180)
1b. Field Calculator:
"cross_angle" = "stream_angle" + 90
2a. Attribute selection:
("stream_angle" > 180 AND "stream_angle" < 270) OR ("stream_angle" > 270 AND "stream_angle" < 360)
2b. Field Calculator:
"cross_angle" = "stream_angle" - 270
3a. Attribute selection:
"stream_angle" = 180
3b. Field Calculator
"cross_angle" = "stream_angle" - 90
4a. Attribute selection:
"stream_angle" = 0 OR "stream_angle" = 90 OR "stream_angle" = 270
4b. Field Calculator
"cross_angle" = "stream_angle"
Voila! cross_angle is represented by the second number in each label.
Please check my selection criteria and math to make sure that it meets your needs!
You'll note that my approach assumes that profiles cross stream segments between vertices. If your profiles cross at vertices, refer to these SE-GIS posts:
- 8,252
- 8
- 35
- 84




2)Middle point of the river 3) North vertical line (N) Angle has to be calculated in this order
– maiyourathaan Feb 25 '22 at 07:50