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
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
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
"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.
SELECT p.* 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)
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).