Question

Insert new nodes to the lines

  • 25 November 2019
  • 2 replies
  • 10 views

Badge +1

Hi all,

 

 

I have two different datasets and both are consist of line string.

 

I would like to insert new nodes in the green line at the projection of the last/first node of the red lines. The desired new nodes are presented by red points in the following picture.

Any idea? Thanks in advance.

 


2 replies

Userlevel 4
Badge +26

Maybe the NeigborFinder? That might help identify the closest feature (the green line) - it should also give you a direction as well. You might first need to create point features out of the last points.

 

 

You can use the VertexCreator to a Vertex, but to do that you need to have the index when you need to insert it which could be tricky.

 

 

Another option would be to extend the Red lines and the use the LineOnLineOverlayer. That should split your Green Line into segments which you can then connect back together again with the new vertex.

 

Something to get started with anyway

 

Good luck @jugoslaviaa

 

 

Badge +3

You can use Snipper in Vertex mode to return the Red lines endpoints. Then, so long as you were confident that these end points were in a tight tolerance to the relevant Green line, AnchoredSnapper set in Segment Mode will both move the Red end points (Set as the Candidates) to the Green Line (Set these as the Anchors) AND output the Green lines on the Anchors port with a new intermediate Vertex with coordinates corresponding to the snapped position of the Red endpoint(s) so that these new features precisely intersect the now Snapped Red end Nodes. If you wanted more precision to stop the Red end points snapping to a closer, but more parallel Green line, you could use LineExtender on the Red lines first to close the distance up a bit more, but that is data dependent.

Reply