mapserver/mapserver — pull request #4716 by tbonfort (2013-07-29 10:37:05+00:00)
Title: implement offseted line outlines

We currently have no way of easily rendering line outlines *only*, i.e. without an accompanying "fill", given that currently outlines are generated by stacking solidly stroked lines. Thus these kinds of renderings are difficultly/not supported for tunnels (note that the the "fill" is semi transparent, it could also have been completely left out):

![line-outlines](https://f.cloud.github.com/assets/358469/870936/7f67ecec-f83a-11e2-845e-ce1cb193bd72.png)

Obtaining such a rendering with the current version requires a bit of mapfile hacking, using
```
style #right outline
color 0 0 0
offset 5 -99 #offseted to the right by half the road width
width 1
pattern 4 4 end
end
style #left outline
color 0 0 0
offset -5 -99 #offseted to the left by half the road width
width 1
pattern 4 4 end
end
style #fill (optional)
color 255 0 0
width 10
opacity 50
end
```

This solution has two major drawbacks:
- the value of the offset has to be explicitely set to half the value of the road width
- we need two STYLE objects, which plays rather badly with the stacking of cached styles (i.e. other road classes will need a fake empty STYLE..END block to push them up one level in the style caching process)

Current patch extends the OFFSET keyword
```
style #outlines
color 0 0 0
offset 10 -999 #offseted to the right and left, 10 pixels apart
width 1
pattern 4 4 end
end
style #fill (optional)
color 255 0 0
width 10
opacity 50
end
```

The special -999 offset Y value, similarly to -99, offsets the input line in both directions by half the value of the specified offset X value. The resulting shape becomes a multiline object.