Solved

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


Badge +6

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?

icon

Best answer by caracadrian 23 May 2022, 07:18

View original

4 replies

Badge +22

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)

Badge +6

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?

Badge +20

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.

Badge +6

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?

 

Reply