I would like to align multiple points to a line, or lines within a layer, using a specified tolerance or buffer around the line objects. Please refer to the sample sketch attached.
For the sake of this example, the points closest to the line in the BEFORE picture are within 5 map units of the line, while the outermost points are over 10 map units away. I would like to snap the closest points onto the nearest line, using a tolerance of 5 map units to achieve the result in the AFTER picture.
Best Answer
There's a built-in tool to do this in the (unreleased) QGIS 3.0 version. You can get a nightly snapshot from the QGIS website to test this in advance.
To do this:
Here's the result, showing the original points as "x", and the snapped points as green dots. I've used a tolerance here so that only some of the input points are snapped.