Skip to main content
Question

Finding closest neighbor based on angle

  • January 9, 2014
  • 1 reply
  • 52 views

Can the NeighborFinder transformer be set to only link features that are of a certain angle range from each other?

 

 

For example, I have two parallel lines running in the east/west direction that represent the edge of the pavement of a road. If there is a point feature somewhere between those lines, can I find it's nearest neighbor line in the North direction (even though the southern line may be closer)?.

 

 

Text Diagram:

 

________________________________________________________ North Line

 

                                   

 

 

                                                    .    Point Feature

 

________________________________________________________ South Line

 

 

Is there any way to link that point to the North Line?
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.

1 reply

takashi
Celebrity
  • January 10, 2014
Hi,

 

 

One possible solution is: 1) Append unique identifier attribute to every point, e.g. "_point_id".

 

2) Send the points to BASE, the lines to CANDIDATE of the NeighborFinder. And specify "Close Candidate List Name" parameter, e.g. "_close".

 

3) Apply a ListExploder to MATCHED points. After exploding by "_close{}", every point will have "angle" and "distance" attributes which are the information of location on a line within the specified distance.

 

4) Filter the points by the specified angle range. Assume each point has min / max of the angle range.

 

5) Sort them by "distance"  ascending.

 

6) Use a DuplicateRemover grouping by "_point_id" to select points having minimum distance in the same "_point_id"; i.e. each first point in the same "_point_id" group.

 

 

Takashi