<html style="direction: ltr;">
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <style>body p { margin-bottom: 0cm; margin-top: 0pt; } </style>
  </head>
  <body style="direction: ltr;"
    bidimailui-detected-decoding-type="UTF-8" bgcolor="#FFFFFF"
    text="#000000">
    On 08/06/2012 09:30, magerlin wrote:
    <blockquote cite="mid:1339137001456-4979880.post@n6.nabble.com"
      type="cite">
      <pre wrap="">I've got a road network which is broken down to a lot of very short sections.
Theese I would like to join by the road name to just get one feature per
road name.

If it had been a polygon layer I could have used the Vector - Geoprocessing
- Dissolve tool, but it is only for polygons.

I am aware that I can do it manually either 2 sections at a time by the
"Join two lines" plugin or more sections at a time by using the "Merge
selected features" button in the Advanced Digitizing toolbar. But there are
far to many sections to do this by hand....

Any suggestions?</pre>
    </blockquote>
    <br>
    If you're willing to work with spatialite, then you can do this with
    a query as follows:<br>
    (Assuming you have a roads shape file, with columns "road_id", and 
    "road_name")<br>
    <br>
    spatialite> .loadshp roads.shp roads LATIN1 4326<br>
    spatialite> CREATE TABLE roads_merged (road_id integer primary
    key, road_name text);<br>
    spatialite> SELECT AddGeometryColumn('roads_merged', 'Geometry',
    4326, 'MULTILINESTRING', 'XY');<br>
    spatialite> INSERT INTO roads_merged (road_id, road_name,
    Geometry) <br>
            SELECT road_id, road_name, CastToMulti(GUnion(Geometry))<br>
            FROM roads<br>
            GROUP BY road_name;<br>
    <br>
    The first line loads a shapefile into spatialite, with LATIN1
    encoding and EPSG code 4326 (Lon/Lat WGS84)<br>
    The second creates a new empty table for the merged roads, and the
    third makes this new table spatial, accepting geometry types
    MULTILINESTRING, and also EPSG 4326.<br>
    The last line, the INSERT uses GROUP BY to merge the rows from the
    original table with the same road name. And the GUnion() function
    merges the line segment's geometry into MULTILINESTRING features.
    (CastToMulti to make sure...)<br>
    <br>
    Give it a try,<br>
    Micha<br>
    <br>
    <br>
    <blockquote cite="mid:1339137001456-4979880.post@n6.nabble.com"
      type="cite">
      <pre wrap="">

-----
Regards Morten

Qgis 1.7.4 Stand alone installer in Win7 64 bit
--
View this message in context: <a class="moz-txt-link-freetext" href="http://osgeo-org.1560.n6.nabble.com/Dissolve-a-line-layer-tp4979880.html">http://osgeo-org.1560.n6.nabble.com/Dissolve-a-line-layer-tp4979880.html</a>
Sent from the Quantum GIS - User mailing list archive at Nabble.com.
_______________________________________________
Qgis-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a>

This mail was received via Mail-SeCure System.


</pre>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>