3

My client wants a map of bus routes rendered as white lines with blue casing. I'm using QGIS 2.8.2 on Mac OSX 10.10.5. I found a .kml dataset here: http://developer.trimet.org/gis/data/tm_routes.kml. I also tried using the .shp.

When I add the layer to the map and apply a cased line styling, some of the routes render as nice unified lines and others render as segmented, like earthworms:

enter image description here

I could easily cheat and render a duplicate layer (featuring only the thin white lines) on top of this one.

Why do the lines render in different ways?

Is there a way to render them all as unified?

marked as duplicate by underdark qgis Oct 8 '16 at 11:32

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

Very nice answer by @AndreJ which should get you the nicest results. An alternative is to change the Cap style of your blue line to Flat. This should get rid of most of those segmented appearences (tested on the .kml file you linked to):

  • Without Flat cap style:

Without flat cap style

  • With Flat cap style

With flat cap style

Hope this helps!

  • Not a perfect solution, but definitely an improvement. It looks best when zoomed in to larger scales. Thank you. – M. Prescott Sep 27 '15 at 6:55
  • @M.Prescott - Most welcome buddy although I would have thought the other solutions would have had a similar effect! – Joseph Sep 30 '15 at 9:37
9

The proper solution to this is using Symbol Levels as explain in this post How do I make line symbols intersect cleanly without showing edges in QGIS?

  • 1
    Thanks for the suggestion. I followed the link, found that option in the interface, and enabled symbol levels. Unfortunately that didn't give me the desired effect. I'm sure it will be useful at some point in the future. – M. Prescott Sep 27 '15 at 6:50
  • 1
    It should actually look the same as with my two layers. The predefined road style with casing consists of two sublayers (black wide and white narrow), and with the Symbol level you can define that the black will get rendered first. Just play around with that beautifull option. – AndreJ Sep 28 '15 at 5:26
2

The simple reason for the interruptions is that the casing is along the line, and around the ends too. In QGIS , there is a possibility to draw lnes with no end cap, but the street casing would stop at the connecting point, and not at the casing of the other road.

The line may be interrupted in the source file, because the street name changes, or what else.

The best way to get nice casings, that obey junctions in a good way too, is to use two layers, one with a width+casing line width and dark colour, and a second with white colour and smaller width on top of it.

By the way, this is the way Openstreetmap styles its Mapnik maps.

  • Thanks for responding. I was hoping to avoid using two layers, but it may be necessary. – M. Prescott Sep 27 '15 at 6:53

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