I have multiple bufferstops on railways. I want to cut out 3m (1,5 m in each direction along the rails) of the railway lines with the buffer stop in the middle. Buffering does not work here because, I do not want to touch lines next to each other.
The railway lines may have more than up bufferstop. It is not certain if the bufferstops are exactly on the lines. some bufferstops are not even on the desired railways in red.
I checked with select by expression and overlay disjoint
if the points are really on the lines. Does not look like it (for the yellow ones). I am using OSM data.
How can I do this (something like buffer along a line)?
with the suggested solution below, QGIS is working but not returing the correct lines.
My project and the geopackage with the bufferstops and the rails: Railwayproject
result:
-Solved- It is important not to use the suggestionbox in "geometry by expression" but the same name as in the layer. So using the suggestion box does not work for me.
overlay_nearest ('bufferstops', $geometry, limit:=1)[0]
. See second screenshot in my updated answer. Check if it works the same for you.overlay_nearest (''bufferstop_e5c.....''
. It should be only one single quote:overlay_nearest ('bufferstop_e5c.....'
- like this, it should work with the simple layer name of the "suggestionbox" as well. See: i.sstatic.net/olQOw.png