Skip to main content
Hi,

 

 

I need to add point to a line. What i am doing,i am using 2dpointadder to my source line file and adding points from the two x,y columns and mapping these x,y columns to 2dpointadder but problem is , point is added to line but i dont have control over the endpoint of line ,from which side it should be extended. I want htis new point joined to the nearest endpoint of line.

 

 

Please help.

 

 

Thanks in advance
Hi,

 

 

How about these steps?

 

1) Create end points of the lines (Snipper, Snipping Mode: Vertex).

 

2) Find the closest additional point for each end point (NeighborFinder).

 

3) Create line segments connecting from each end point to the closest additional point (PointConnector).

 

4) Join the line segments and the original lines (LineJoiner).

 

Takashi
Does the line have x, y values (coordinates of additional point) as its attributes? If so there is another approach:

 

1) Extract coordinates of both ends (start, end) of the line (CoordinateExtractor)

 

2) Calculate distances of fstart -> point] and dend -> point] (AttributeCreator or ExpressionEvaluator).

 

3) Check which distance is shorter (Tester). If Istart -> point] is shorter, reverse the line direction (Orientor).

 

4) Add a point to the line (2DPointAdder).

 

 

Takashi
thank you Takashi its working fine

Reply