Skip to main content
Question

adding point to line

  • August 29, 2013
  • 3 replies
  • 230 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
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

takashi
Celebrity
  • 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
Celebrity
  • 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