Solved

center line

  • 6 December 2022
  • 1 reply
  • 6 views

Badge +4

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?

icon

Best answer by evieatsafe 13 December 2022, 22:57

View original

1 reply

Userlevel 1
Badge +15

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!

Reply