Question

adding point to line

  • 29 August 2013
  • 3 replies
  • 28 views

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

3 replies

Userlevel 2
Badge +17
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
Userlevel 2
Badge +17
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 [start -> point] and [end -> point] (AttributeCreator or ExpressionEvaluator).

 

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

 

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

 

 

Takashi
thank you Takashi its working fine

Reply