Question

Snap line endpoints to points in the z-direction only

  • 6 May 2024
  • 1 reply
  • 30 views

Badge

Hi everybody!

I have a point layer and a line layer. The line layer consists of connected lines, and at the lines endpoints there is a point from the point layer in the exact same location. I moved the points in the z-direction because their height had to be corrected (new z-values were derieved from a point cloud). Now i also want to move the corresponding line endpoints in z-direction as well so that they again match the points in x, y and z. I guess the AnchoredSnapper with Group Processing could do the job but don’t know how to prepare the data for that. Can anyone help me with this? 

red: original position of points and lines; green: points moved in z-direction due to height correction
Question: How can I make the lines follow the points in z-direction? 
I am grateful for any advice!


1 reply

Userlevel 6
Badge +34

The closest thing out of the box to do this is the surfacedraper. This tool creates a surface from input points (the pointcloud), generates a surface from it and changes the z of the drape features to that of the surface.

Generating a surface can be time consuming, so it might be wise to clip the pointcloud upstream of the surfacedraper.

A different approach would be to explode the pointcloud into points (PointCloudCoercer), extract the z to an attribute and find the closest point using the NeighborFinder. Merge the attributes and set the z with a 3DForcer from the attribute from the closest point.

What is better / quicker depends on the data.

===

Added workspace demonstrating this.

Reply