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

1 Answer 1

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

1
  • 1
    Thanks works great !
    – Kalak
    Apr 19, 2022 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.