Skip to main content
Question

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

  • June 16, 2025
  • 2 replies
  • 68 views

gbcfgeo2025
Contributor
Forum|alt.badge.img+3
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
Influencer
Forum|alt.badge.img+28
  • Influencer
  • June 16, 2025

You might want to use the AnchoredSnapper transformer instead. 

 

 


takashi
Celebrity
  • 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.