Skip to main content
Solved

I want to present 3D data along a line with breakpoints. For this to work I need the line to be presented as a straight line so first I need "to straighten the line" and this is where I fail


peteralstorp
Contributor
Forum|alt.badge.img

Hi, fellow FMEers! I a problem that I cannot solve. I want to present 3D data along a line with breakpoints. In my script I want the line to be presented as a straight line (a profile).

 

It is important that the length of the line parts are correct but it doesn't matter where the resulting parts start.

 

The data input line is drawn from start to end but can begin and end anywhere (from west to east, north to south and so forth...).

 

Any hints or suggestions?

 

image

Best answer by nielsgerrits

Credits to my buddies @work, this was a team effort :)

  • Chopper to chop the line into lines of 2 vertices.
  • LengthCalculator to get 3D length.
  • StatisticsCalculator to calculate cumulative lengths.
  • VertexCreators to recreate segments.

 

 

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

4 replies

david_r
Evangelist
  • January 15, 2024

You could split up the parts (Deaggregator and/or Chopper), followed by a LengthCalculator to get the 3D length of each part as an attribute. You can then iterate over the parts and reconstruct them in 2D space, e.g. using the VertexCreator (Replace with point + Add point). If you start at (0,0) and go from there it should be easy to line them up. You can then shift them later, if necessary (Offsetter, or the like).


nielsgerrits
VIP
  • Best Answer
  • January 15, 2024

Credits to my buddies @work, this was a team effort :)

  • Chopper to chop the line into lines of 2 vertices.
  • LengthCalculator to get 3D length.
  • StatisticsCalculator to calculate cumulative lengths.
  • VertexCreators to recreate segments.

 

 


peteralstorp
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • January 15, 2024
david_r wrote:

You could split up the parts (Deaggregator and/or Chopper), followed by a LengthCalculator to get the 3D length of each part as an attribute. You can then iterate over the parts and reconstruct them in 2D space, e.g. using the VertexCreator (Replace with point + Add point). If you start at (0,0) and go from there it should be easy to line them up. You can then shift them later, if necessary (Offsetter, or the like).

@david_r​  Thank you, David! Much appreciated.


peteralstorp
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • January 15, 2024
nielsgerrits wrote:

Credits to my buddies @work, this was a team effort :)

  • Chopper to chop the line into lines of 2 vertices.
  • LengthCalculator to get 3D length.
  • StatisticsCalculator to calculate cumulative lengths.
  • VertexCreators to recreate segments.

 

 

@nielsgerrits​ And for that team effort I'm very grateful. Thank you so 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