Thursday 23 June 2016

style - Setting rendering order of line layers in QGIS


I have a dataset where different road types are in separate layers, i.e. motorways, primary roads and secondary roads. In turn, each layer is subdivided by embedded codes into different sub-types - 4 lane roads, 2 lane roads etc.



I currently have the layer style set so that each road is outlined in black. Thanks to another answer to a question here on GIS SE, I already know how to make different road segments 'blend together' so the black outline remains 'underneath' the colour using symbol levels, and that works fine.


However, because for example, the primary roads are in an entirely separate layer to the secondary roads, and are obviously above them in the rendering order, the black outline of the primary roads cuts over the colour line of the secondary roads. This has the effect of making any secondary road that meets a primary road look like a dead end.


The drawing order is essentially:


Primary road colour
Primary road outline
Secondary road colour
Secondary road outline

When it needs to be:


Primary road colour

Secondary road colour
Primary road outline
Secondary road outline

So that the colour line of the Secondary road blends seamlessly with that of the Primary road. Within a layer this is obviously handled by Symbol Levels, but this is overridden by the layer order. Drawing Layer 0 in the Primary road layer is still higher than Drawing Layer 1 in the Secondary road layer.


How can I fix this?



Answer



Another approach (besides Nathan's) would be to merge both layers into one. Then you could use symbol levels as usual.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...