Skip to main content
Question

How to Snap Points to the Nearest Location on a Polyline in FME 2023?


gbcfgeo2025
Contributor
Forum|alt.badge.img+2
Hi Community,
I'm working with FME 2023 and I need to snap these purple points to the closest locations along the yellow polyline. What's the best way to do this?
How do I use the Snapper transformer properly in this case?
Could you please share an example workspace?
I've attached the relevant data—thanks in advance for your help!

 

2 replies

alexbiz
Enthusiast
Forum|alt.badge.img+12
  • Enthusiast
  • June 16, 2025

You might want to use the AnchoredSnapper transformer instead. 

 

 


takashi
Evangelist
  • June 17, 2025

Hi ​@gbcfgeo2025 ,

If the requirement was to snap the points to the closest vertex of a line, AnchoredSnapper (Snapping Type: Vertex Snapping) would work as expected. However, I think a combination of NeighborFinder and VertexCreator would be better, if you need to snap the points to the closest location on a line regardless of it matches a vertex or not.

  1. NeighborFinder : Send the point features to the Base port, send the line features to the Candidate port.
  2. VertexCreator (Mode: Replace with Point) : Move the points to the closest location on a line. 

Just be aware, the coordinates of a moved point could not match the coordinates of a point on the line with mathmatical precision, since there must be an unavoidable calculation error with computer calculation.


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