[GIS] QGIS offset dash line style – dash spacing does not vary with rotation

lineqgisstyle

I'd like to make a USGS-style dirt road marker but with smaller dashes and bigger spacings (i.e. less duty cycle) to indicate lower quality road.

First attempt = two simple lines, custom dashes of the same value, offset same distance in opposite directions.

Problem is, when the line goes around a curve, the spacings don't automatically adjust (stretch on outside of curves, compress on inside of curves) to account for the curve, so you get something that looks like phase shifting or 'pulling' of one side relative to the other

enter image description here

So, some attempts to fix that:

  1. solid black line, centered, say width = 1; solid white line on top, centered, say width=0.6; so, this works to keep the dashes across from each other as the line curves, but, the center line that covers/hides the black is solid white – not transparent as in a USGS. Anyone know of a way to do that?

  2. change it to a marker layer – I used a font marker, picked a colon, set the y offset so it's basically centered, and good to go. The 'rotate' checkbox, on by default, seems to keep the dashes 'across' from each other as desired. Problem is, it's pixellated and a bit chunky looking.

So, is the cleanest solution to make a svg that looks nice and use that? Not sure how it will handle compressing on inside of curves vs stretching on outside of curves. What would really win is a checkbox in the dashed line type that says 'keep offset dashes across from each other around curves' or such, akin to the 'rotate marker' checkbox for marker lines.

Best Answer

In QGIS 2.0, your solution no. 1 will work if you combine it with the new layer blending mode feature option "darken". It basically makes the white parts of the line transparent:

enter image description here

Related Question