Skip to main content
Solved

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

  • September 6, 2021
  • 2 replies
  • 88 views

Forum|alt.badge.img+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

Best answer by nielsgerrits

  • 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.

View original
Did this help you find an answer to your question?

2 replies

nielsgerrits
VIP
Forum|alt.badge.img+54
  • Best Answer
  • September 6, 2021
  • 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.


Forum|alt.badge.img+1
  • Author
  • September 6, 2021

That solved the problem perfectly. Thank you very much!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings