I have one (very) long line (e.g. line 2) I also have another line (line 3) which nodes are snapped with two vertexes of line 2. I want to break line 2 up in three segments. Is this possible by using qgis? Is there a way to do this automatically? (All the lines are on the same layer btw)
2 Answers
You can use the 'Split lines with lines' tool in the Processing toolbox > QGIS geoalgorithms > Vector overlay tools. You then double-click the tool to launch it. Then enter the same layer as input layer and split layer.
As your lines are on the same layer, the result will be 4 lines: 3 lines for line 2 and line 3.
EDIT : This tool seems to exist only from version 2.8.
-
This is great! Thanks! I had to switch from 'simplified interface' to 'advanced interface' to find it, but from there on it was very easy.– ervazuCommented Apr 7, 2015 at 10:25
From the processing toolbox you should be able to use the v.clean GRASS command, and the break function. Which will break lines at each intersection.
http://grass.osgeo.org/grass71/manuals/v.clean.html
Although with GRASS there may be issues with loosing attributes, so keep that in mind.