I have a group of lines (bus lines, some of them coincident in some sections) that I want to convert into a single polyline (or polygone) to style it as a single entity.

I know how to put them into one single shapefile, using "Vector > Data Management Tools>Merge Shapefiles to one".

The problem I have is that I want to show the whole shapefile with a single style, but QGIS keep working with all the lines separately, even if they are in a single Shapefile. Here an example of this:

Overlap style

The first thing I tried is to use the Dissolve Geoprocessing tool from Vector menu, but I get the same result as merging shapefiles.

I've tried to convert all the lines into polygones, through "Geometry Tools > Lines to polygones", but this is what i get:

Lines to polygones

I've also tried using the Polygonize tool from Processing plugin, and this is the result:


I don't know how to convert all the lines into a single polygon that i can style to obtain something similar to the first image but with no overlaping (just the outer segments in black, with no crossing of black lines).

The only solution I can imagine would be very time consuming and not very elegant (and may not work) is to create buffers for all the lines and then dissolve all this buffers. That may create a single polygon that can be styled as I want. The problem is that I have more than 70 lines.

Any solution / approach?

(QGIS 2.8.6 on Windows 7)

  • When you ran the Dissolve tool, did you select the Dissolve all option?
    – Joseph
    Oct 7 '16 at 11:38
  • This option is not enabled in the QGIS version I'm working with (2.8.6). At least in "Vector > Geoprocessing tools > Dissolve". I've tried to use the dissolve tool of the Processing plugin, that has this option, but still having the overlap issue :( Oct 7 '16 at 11:44
  • Perhaps you mentioned this in a previous question but is there a reason why you can't upgrade to a more recent version of QGIS? There have been issues in early versions where certain geoprocessing tools did not perform they way they should.
    – Joseph
    Oct 7 '16 at 11:48
  • The reason is that I'm in the middle of a project with a nearby deadline, so I'm afraid of upgrading my QGIS version. I intended to do that once I finish what I'm doing now. Oct 7 '16 at 12:13
  • 1
    Why don't you use OSGeo4W to install the test version of the latest QGIS (which you can do side by side with your current version I think) and run concurrently. 2.8 is pretty old in QGIS terms!
    – Stev_k
    Oct 7 '16 at 14:32

If you need to handle the polylines just for styling, you don't need to manipulate the geometry. E.g. you want to get rid of overlapping edges at a street intersection, you can to this by activating "symbol levels" in "Layer properties / style". You can set the drawing level of each part of your style.

Without symbol levels (before): edges are overlapping at intersections.

With symbol levels (after): edges are drawn behind, the orange fill is drawn above

Symbol levels in QGIS with/without symbol levels


If the symbol levels don't work for you (not sure when it was implemented), you can simply duplicate the layer, style the first with 1mm red, and the second with 2mm black:

enter image description here

The order in the legend decides which one is drawn on top of the other.

  • Hi @AndreJ, as far as I know, symbol levels exists at least since QGIS 1.7 (maybe even before). Your idea is a good workaround - on the downside, you have to keep two layers styles in sync in case you want change the stroke width etc.
    – Greg Z
    Oct 9 '16 at 7:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.