2

I have been trying to snap points to a line layer (vertex or segment) but the "Snap Geometries to Layer" processing algorithm with behavior 3 supposed to do what I want

Prefer closest point, don’t insert new vertices.

(Snap to closest point, regardless of it is a node or a segment. No new nodes will be inserted.)

don't seem to work as supposed enter image description here

How am I supposed to snap the point to the middle of the line (the real closest point) using this tool ? or am I using the tool wrong and there is something I am not getting

Taras
  • 32,823
  • 4
  • 66
  • 137
Kalak
  • 3,848
  • 8
  • 26

1 Answers1

3

The behaviour of this tool is a bit tricky, indeed. So instead of snapping, better create the closest point on the line layer using QGIS expressions with Geometry generator or Geometry by Expression (see here for details):

closest_point( 
     aggregate( 
        'lines',  -- name of your line layer
        'collect',
        $geometry
    )
    ,
    $geometry
)

enter image description here

Babel
  • 71,072
  • 14
  • 78
  • 208