Skip to main content
Solved

Transform a 2d line to a 3d line using z-values from nearby points


mathiku
Supporter
Forum|alt.badge.img+7

I have a centerline for a river (2d) and some nearby measurement (3d-points).

I want to single create a 3d line that takes the z-values from point within a distance of 100m.

So far I tried chopping up the line using the pointOnLine-overlayer, but I can't transfer the z-values nor relevant attributes.

I tried several approaches, like deconstructing the line into points, but I feel I am missing something crucial.

Does anyone have a solution or some advice?

Best answer by caracadrian

Use Chopper with Mode set to By Vertex, Maximum Vertices 1. Send them to a Counter (you need it later on). Send the output to the Base port of a NeighborFinder.

Put the @ZValue() of of the 3d points in a new attribute (AttributeCreator, AttributeManager) and send them to the Candidate port of the NeighborFinder.

Set NeighborFinder to Number of Neighbors to Find 1, Maximum Distance 100 and check Merge Attributes.

Use 3DForcer on the MatchedBase output port features set as Elevation: the_attribute_you_put_the_@ZValue()_in, Preserve Existing Z Values: No.

Send the output of 3DForcer to a Sorter (sort numeric by count attribute from Counter) and then to a LineBuilder.

And you should have a 3d line.

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

4 replies

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • May 20, 2022

You should be able to use the coordinateExtractor on the points to store the Z value as an attribute, the pointOnLineOverlayer to transfer the Z attribute to the the lines, and then the 3DInterpolator on the lines (with Starting and Ending elevations coming from the Point Z attributes)


mathiku
Supporter
Forum|alt.badge.img+7
  • Author
  • Supporter
  • May 21, 2022
jdh wrote:

You should be able to use the coordinateExtractor on the points to store the Z value as an attribute, the pointOnLineOverlayer to transfer the Z attribute to the the lines, and then the 3DInterpolator on the lines (with Starting and Ending elevations coming from the Point Z attributes)

"pointOnLineOverlayer to transfer the Z attribute to the the lines," - The points have different height, but all the lines end up wit the same indice?


caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • Best Answer
  • May 23, 2022

Use Chopper with Mode set to By Vertex, Maximum Vertices 1. Send them to a Counter (you need it later on). Send the output to the Base port of a NeighborFinder.

Put the @ZValue() of of the 3d points in a new attribute (AttributeCreator, AttributeManager) and send them to the Candidate port of the NeighborFinder.

Set NeighborFinder to Number of Neighbors to Find 1, Maximum Distance 100 and check Merge Attributes.

Use 3DForcer on the MatchedBase output port features set as Elevation: the_attribute_you_put_the_@ZValue()_in, Preserve Existing Z Values: No.

Send the output of 3DForcer to a Sorter (sort numeric by count attribute from Counter) and then to a LineBuilder.

And you should have a 3d line.


mathiku
Supporter
Forum|alt.badge.img+7
  • Author
  • Supporter
  • June 3, 2022
caracadrian wrote:

Use Chopper with Mode set to By Vertex, Maximum Vertices 1. Send them to a Counter (you need it later on). Send the output to the Base port of a NeighborFinder.

Put the @ZValue() of of the 3d points in a new attribute (AttributeCreator, AttributeManager) and send them to the Candidate port of the NeighborFinder.

Set NeighborFinder to Number of Neighbors to Find 1, Maximum Distance 100 and check Merge Attributes.

Use 3DForcer on the MatchedBase output port features set as Elevation: the_attribute_you_put_the_@ZValue()_in, Preserve Existing Z Values: No.

Send the output of 3DForcer to a Sorter (sort numeric by count attribute from Counter) and then to a LineBuilder.

And you should have a 3d line.

Thanks a lot - I finally found some time to test it.

 

For my given exmaple 892 features comes out of the MatchedBase port, 28.882 of the UnmatchedBase port, and I don't see how you rmethod takes care of that when creating the line. Can you explain the interpolation part?

 


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