Skip to main content
Question

adding point to line

  • August 29, 2013
  • 3 replies
  • 153 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

takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • August 29, 2013
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

takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • August 29, 2013
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

  • Author
  • August 30, 2013
thank you Takashi its working fine

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings