[GIS] Automatically adding nodes to vertices on lines using QGIS

linenodesqgisroadvertices

I'm currently using QGIS 2.17 to process map data and for drawing roads. I'm trying to add nodes whenever a road breaks, turns or starts/ends.

I've tried using the plugin "Locate points among lines" but it has one error : it adds a node to both a start and end of a road point instead of linking it with the next road point, which means I've got 1 extra node on each start and end of road to delete.

(A road "breaks" whenever it reaches an intersection/pedestrian crossing, and a new road linked directly with the previous road starts.)

Basically I want to do this:
O–>O———>O instead of this OO—–>OO———->OO

Is there a way to automate this process?

Best Answer

QGIS 3

Use the "Split with lines" tool from the Processing Toolbox (Ctrl+Alt+T).

qgis_3

QGIS 2

You can use "Split lines with lines tool" in QGIS from Vector overlay Tools > Split lines with lines to add node when two lines get connected together. The input line file can be the same file for input layer and split layer, as you can see below:

enter image description here

After running the "Split lines with lines" tool and use same file for input layer and split layer, as you can see below:

enter image description here

The output will be like this:

enter image description here

The "Split lines with lines" tool can be found in the Processing Toolbox:

qgis_2