
GeoServer Beginner's Guide

On many paper maps, a common symbol for representing roads under construction or planned is a couple of parallel dashed lines. Can you imagine how to do it with SLD? It requires a couple of lines merged together with a new SLD element. We will see that element in this section:
Take the Roads.xml
file and make a copy to DashedRoads.xml
, then edit the new file in your text editor.
Go to line 9 and replace the text inside the Name
element with the following code:
<Name>DashedRoads</Name>
Go to line 11 and replace the text inside the Title
element with the following code:
<Title>Geoserver Beginners Guide: Roads under construction with dashing</Title>
Go to line 17 and change the width of the symbol to 5
:
<CssParameter name="stroke-width">5</CssParameter>
Add a line just after the previous line to set dashing for the black lines:
<CssParameter name="stroke-dasharray">15 10</CssParameter>
Go to lines 22...
Change the font size
Change margin width
Change background colour