How can I split a road network into different links splitting at intersections??
The whole network is in one single layer.
QGIS Polyline Split – How to Split a Polyline at Intersections in QGIS
lineqgisroad
Related Solutions
A robust method to match networks is described in Mustière, S., Devogele, T., Dec. 2008. Matching networks with different levels of detail. GeoInformatica 12 (4), 435-453.. It has been used at the French national mapping agency to match 2 geographical databases with different levels of detail (see image below). The purpose was to do exactly what you need: Transfer of attributes.
This matching process compares the two network elements taking into account geometrical and also topological criteria: Network elements are not matched only if they are closed to each other (using Hausfdorff distance) and with comparable shapes, but also if they are connected to other network elements that are matched together. One-to-many relations are used.
A good news: This process is implemented in the opensource GéOxygene library. This document describes how to use it. Bad news: You have to speak both Java and French to use it...
Multi-part lines constructed with tools like Dissolve or Merge do not necessarily order the parts that touch at branches in a sequential order that would keep the parts together. So the line parts on the same physical side of a branch can be on opposite sides of the part sequence internal to the line. Parts are always traversed sequentially by tools. This makes sense for such complex multi-part lines, since once it reaches an end point of a part that touches no other line how can it know which line part to put next? It has no idea what branches may split and which won't, of if one part will have to split into two or more parts when points occur inside a line part, so there is no way to do that organization in advance. Anyway, the polyline parts are never organized in advance by "sides" of an infinite set of unknowable points that could split the line up, and the tool makes no attempt to do tracings while the splits are occurring. Therefore all branches break apart with this tool.
To get branches organized into parts you would need to write your own tool. The easiest process I can think of is to do the splits as usual, that way you will be working with the full set of lines, including new segments that split at places other than the branches. Then buffer the split points by a small distance (say a centimeter or one-half foot). Next calculate the ObjectID of the original lines after the split into a new long field and then make a copy of the split lines. Erase the portions of all copied split lines that fall inside of the split point buffers. Now buffer the copied and trimmed lines by an even smaller distance (say 1/2 centimeter or 1/4 foot). Dissolve the line buffers into single part polygons. Next spatial join the trimmed lines to the single-part dissolved buffers keeping the line shapes. This will associate the buffer ObjectID to the line set that falls within it and they will not cross the split points. Now you can select each line set by that buffer FID, relate them back to the original lines that were not trimmed and Merge/Dissolve each set of lines. Python could do the iterations more elegantly than ModelBuilder, so learn Python.
The rule of geoprocessing is always make complex items the last things you work with. Always work with the simplest items (single line parts) first and then add complexity at each stage of your script in an order that each stage is handled efficiently. Also each additional level of complexity should only be introduced into the process when the simpler objects cannot help move the process forward to the ultimate goal.
Best Answer
You need to use
Split lines by lines
tool, and use the same file as input layer and split layer, as you can see below:You can find the tool from
Processing toolbox -> QGIS Geoalgorithms -> Vector Overlay tools -> Split lines by lines
Here is the tool in the Processing Menu:
Before running the tool:
After running the tool:
Update for QGIS 3.x
Although the tool has the same name in
SAGA -> Vector line tools
, it has a different name in QGIS 3.x. The new name isSplit with lines
located underProcessing tools -> Vector overlay -> Split with lines
: