Skip to main content
Solved

Find all lines that connect to a point

  • December 13, 2016
  • 7 replies
  • 278 views

Hi all,

I believe this should be simple but being new to FME, I am having the hardest of times.

I have a few points. I have a network of lines. I need to find network segments which intersect with the point. If they do, then all the segments that touch the point, their ID attribute should be transferred to that point. Some points are only touching one line whereas others are touching more.

I tried using SpatialFilter with Merge attributes selected, and checking for intersection or touching, but for a candidate point, it only merges and outputs the first segment that it touches and discards the others.

I have tried PointOnLineOverlayer... that seems to not even output lines. Not sure what's going on there.

Please take a look at the attached picture. The result I am looking to achieve is below:

Point ID Network ID

1 3

2 1

2 2

2 3

Any help would be greatly appreciated.

Best answer by jdh

What about using the SpatialRelator instead of the SpatialFilter. That should produce a list of all the lines that intersect each point.

View original
Did this help you find an answer to your question?

7 replies

erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • December 13, 2016

Have you tried the NeighborFinder (distance = 0) with the points as base and the lines as candidate?

Use the list to get the ID's of all lines and then the ListExploder to create the list of relationships (Point ID and Network ID).


erik_jan wrote:

Have you tried the NeighborFinder (distance = 0) with the points as base and the lines as candidate?

Use the list to get the ID's of all lines and then the ListExploder to create the list of relationships (Point ID and Network ID).

Hi @erik_jan

 

Thanks for the suggestion. I tried using NeighborFinder with distance = 0 but it only seems to match less than half the entries. SpatialFilter picks up twice that amount, even after dropping network lines that touch a point more than once.

 

Something definitely not working there..

 

 


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • Best Answer
  • December 13, 2016

What about using the SpatialRelator instead of the SpatialFilter. That should produce a list of all the lines that intersect each point.


jdh wrote:

What about using the SpatialRelator instead of the SpatialFilter. That should produce a list of all the lines that intersect each point.

That worked me. I was completely unaware of how SpatialRelator worked. Thank you!

 

 


erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • December 14, 2016
fariyafarhad wrote:
Hi @erik_jan

 

Thanks for the suggestion. I tried using NeighborFinder with distance = 0 but it only seems to match less than half the entries. SpatialFilter picks up twice that amount, even after dropping network lines that touch a point more than once.

 

Something definitely not working there..

 

 

Have you set the maximum number of candidates to more than 1? If not only the first match will be in the list.

 

 


erik_jan wrote:
Have you set the maximum number of candidates to more than 1? If not only the first match will be in the list.

 

 

I did set the maximum number of candidates to 10. It did something odd

 

 


erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • December 14, 2016
fariyafarhad wrote:
I did set the maximum number of candidates to 10. It did something odd

 

 

I attached an example fmw.

 

point-line-connections.fmw

 

 


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