Skip to main content
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!

 

You might want to use the AnchoredSnapper transformer instead. 

 

 


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.