I have shp file with 50k lines (roads).
Many roads have same name like 'high road' . some of them are the same road (they intersect each other) and some are located in different places of the city.
I want to merge all lines with same name and that intersect to single road. How can I do that? I have available SQL 2012 spatial with geometries and geographic data of roads and QGIS with shp file,
Someone told me in other post to use dissolve, but it looks like dissolve works on polygons only (i don't have selection for line vector layer)
Best Answer
I can describe how to do this in spatialite. You'll probably be able to adapt it to sql server. First import the shapefile into spatialite
Suppose the roads table now has columns: id as primary key, name, and geometry. Create a duplicate, empty table for the merge:
Now insert into the new table the columns that intersect with identical names:
And now insert all the single roads:
I would probably first create a spatial index and use it in above the query.
HTH, Micha