Solved

How to calculate average azimuth of lines in sets of 1-3 lines.

  • 6 September 2021
  • 2 replies
  • 12 views

Badge +1

My situation is this. I have a number of lines in a gdp on top of which I have some points (with a unique id called nodename). I want to rotate these points based on the angle of the lines. What I have done so far to achieve this is to make a buffer around the points, clip the lines using the buffer. Use the horizontalanglecalculator to calculate the azimuth of the lines. However some points have 3 lines coming through them meaning I have 3 angles for 1 point. I need to calculate the average of the x number of angles for each nodename.

 

Can anyone help me with this? See the picture below.

 

Udklip 

Regards Rasmus

icon

Best answer by nielsgerrits 6 September 2021, 09:00

View original

2 replies

Userlevel 6
Badge +31
  • Assign unique ID's to points called point_id using a UUIDGenerator.
  • Merge attributes when clipping, so the lines get the point_id attribute.
  • Clipped lines to StatisticsCalculator, calculate average, group by point_id, summary outputport.

Now you have one feature for each point with the average of the angle.

Badge +1

That solved the problem perfectly. Thank you very much!

Reply