I have a Shapefile with a road network (lines) which includes several road segments (lines).
Is there any way to merge all these lines into one line using QGIS?
Tested on QGIS 2.18 and QGIS 3.4
I can suggest using a
"Virtual Layer" through
Layer > Add Layer > Add/Edit Virtual Layer...
Let's assume we have seven features in
"roads", see image below.
With the following Query, it is possible to achieve the result
SELECT COUNT(*) AS features, ST_Union(r.geometry) FROM roads as r
The output Virtual Layer will create one continuous layer out of all road segments' geometries and additional field 'features' which will count how many features were merged.