How I can delete points along a line, with a distance tolerance?

As you can see in the figure, the points near the line should stay, the points between the lines should be deleted


  • 1
    Buffer the line layer by x m, then use select by postion and return every point, which intersects or is within the buffer. – Erik Jun 12 '19 at 11:47

Tested on QGIS 2.18 and QGIS 3.4

I can suggest using a "Virtual Layer" through Layer > Add Layer > Add/Edit Virtual Layer...

Let's assume we have the following layers "points_along" and "lines", see image below.


With the following query, it is possible to extract only those points that are within a distance tolerance, in my case I used 100m.

FROM "points_along" AS p, "line" AS l
WHERE ROUND(ST_Length(ST_ShortestLine(p.geometry, l.geometry)),2) < 100

The output Virtual Layer with its Attribute table will look as following


How to check if the query is correct, simply proceeding with Vector > Geoprocessing tools > Fixed distance buffer (100m)

|improve this answer|||||

The easiest method would be to build a buffer first. (Vector --> Geoprocessing tools --> Buffer). Then delete all the points within that buffer. (Vector --> Geoprocessing tools --> Difference).

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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