Skip to main content
Solved

center line

  • December 6, 2022
  • 1 reply
  • 9 views

bayram
Contributor
Forum|alt.badge.img+5

Hi, I have 2 lines and they have real elevation value (z value). I want to add lines which exaclty middle of 2 lines. Also the new line should has actual z value . ( average z of 2 lines). How can I do?

Best answer by evieatsafe

Hi @bayram​ thanks for your question! From your description my understanding is that you would like this new line to have the same vertices as the other two lines but with z values elevation) that are between them as a vertical center line? There might be a couple of ways to achieve this, but here's one:

  • exposing the vertices coordinates of each line (CoordinateExtractor & ListExploder)
  • join on list indices, with z value attributes having two different names (FeatureMerger/FeatureJoiner)
  • calculating the middle value (difference/2)+z (AttributeCreator/AttributeManager/ExpressionEvaluator)
  • replace the lines with points using the new z values (VertexCreator)
  • rebuilding the line, but make sure it is sorted correctly first (LineBuilder)

imageHope this helps, or provides you with some ideas!

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

1 reply

evieatsafe
Safer
Forum|alt.badge.img+20
  • Safer
  • Best Answer
  • December 13, 2022

Hi @bayram​ thanks for your question! From your description my understanding is that you would like this new line to have the same vertices as the other two lines but with z values elevation) that are between them as a vertical center line? There might be a couple of ways to achieve this, but here's one:

  • exposing the vertices coordinates of each line (CoordinateExtractor & ListExploder)
  • join on list indices, with z value attributes having two different names (FeatureMerger/FeatureJoiner)
  • calculating the middle value (difference/2)+z (AttributeCreator/AttributeManager/ExpressionEvaluator)
  • replace the lines with points using the new z values (VertexCreator)
  • rebuilding the line, but make sure it is sorted correctly first (LineBuilder)

imageHope this helps, or provides you with some ideas!


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