#24 GeometrySnapper snaps to far point

open
nobody
None
5
2011-12-12
2011-12-12
Sandro Santilli
No

Snapping LINESTRING(0 0, 10 0) to LINESTRING(0 0, 9 0, 10 0, 11 0) snaps the (10 0) vertex of the first geometry to the (11 0) vertex of the second one rather than keeping it where it is, since the second geometry has one point in that exact position.

Sounds like a bug, what do you think ?

Origin of the report: http://trac.osgeo.org/geos/ticket/501

Testcase attached.

Discussion

  •  
    Attachments
  • The idea here is that snapping could occur toward the closest point rather than toward the first scanned point falling below the threshold. Does it make sense ? Would you accept a patch in this direction ?

     
  • Martin, have you ever read this ? It's been some time now ... :)
    I was thinking that avoiding segment snaps where the closest point is an endpoint should also resolve this case, with less performance penalty.