I have an original polyline layer and a modified one representing only a part of the original network. In an example case I cut 10 meters at start and end of each feature using Geometry by expression
tool in QGIS. Then I use the Difference
tool to have a layer only containing the parts where the original layer and the cut lines do not overlap.
Unfortunately, this does not work as expected. There seems to be a critical accuracy issue, as nothing is being subtracted or only some "random" parts are being erased.
As a workaround I add a minimal buffer to the cut features (not even that minimal actually, but 0.001 meters in my example case). Then it works, but with reduced accuracy.
Obviously this is not a working solution to subtract polyline layer B from polyline layer A, where layer B basically has the same geometry in exactly the same positions, but e.g. with some erased parts. The Difference tool somehow seems to be suitable only for cases where the overlay is a polygon layer.
What is the best way to get the accurate difference between two polyline layers in QGIS?