[GIS] Calculate distance from all points to all lines within 10km using FME

fmegeometrylineperpendicularpoint

I have a polyline shapefile and a point shapefile. The points are along the polylines. There are over 100 lines and over 10,000 points. I want to calculate the perpendicular distance from every point to every line within 10km except for the line that the point is on.

I'm happy to calculate lines representing these distances. My first thought was to use the NeighborFinder transformer. However, this only seems to calculate the nearest line which is the line that the point is on (zero distance).

Sample image of data:
enter image description here

Is there a way to have the NeighborFinder find all of the closest lines within 10km? How else can I accomplish this? Perhaps a looper?

Best Answer

I have figured this one out.

I ended up using the NeighborFinder as I initially suspected. The trick is to store all candidate details in a list (I called it NeighbourList).

enter image description here

I then connected that to a ListExploder to create features from all elements in the list. Then I used a tester to filter out the features with a distance of zero. Finally, I used a VertexCreator to add a vertex at the candidate location to make a line.

The results are:

enter image description here

There is still some work needed to get rid of non-perpendicular lines at the bends of the black lines. But generally, the results are good.

enter image description here

Note the gap is where the lines are greater than 10km apart.