Assign attributes from nearby line to another line in FME

NeighborFinder will do what you need. New = base, old = candidate. Parameters: 1 candidate to find, distance 5m. The only challenge is to prevent matching the wrong candidate at intersections. Snipping off first and last point of both the base & candidate features should do the job.

======= update 20160620 As Mark suggested adding the AzimuthCalculator should solve the wrong match problem. You need to calculate the overall bearings from both sets, find the matching lines with the NeighborFinder and then test the result based on the difference between the bearings from the matched lines. See added screenshot.

enter image description here You need to iterate what variables for Distance (NeighborFinder) and difference in bearing (Tester) works the best for your data.


Yes, the NeighborFinder transformer finds the closest 'candidate' to each 'base'.

Additionally, I would try a custom transformer we have called the PolylineAnalyzer. This transformer will tell you the overall bearing of each feature. If the bearing of the features you are matching are not within (say) 5 to 10 degrees of each other then it's likely to be the wrong match.

For example, in your screenshot the vertical yellow line is closer to the horizontal red, rather than the vertical red:

enter image description here

NeighborFinder by itself could produce the wrong result, but the bearings would be closer to 90 degrees different, highlighting that potential issue.

Tags:

Fme