I have a polyline layer and I want to find if a linestring is snapped to the nearest linestring or not in QGIS. How can I do that in QGIS?
I am checking for the intersection but the intersection code is not working because the line string is snapped. So I want to find the snapping linestrings.
def lines(l_layer): for ln1,ln2 in itertools.combinations(l_layer.getFeatures(),r=2): print ln1.id(),ln2.id() if ln1.geometry().intersects(ln2.geometry()): print('intersects') print ln1.id(),ln2.id() else: print('not intersects')
Here I am not getting one linestring which is touching with the other because it is snapped and it doesn't have the vertex. So I want to find if the line is snapped.