
GeoServer Beginner's Guide

In the previous section, we styled a thematic roads map. It is a pretty map, but it lacks something to be ready for publication. As a user, you would expect roads be drawn on different scales according to their classification. SLD has elements to define a scale range where a rule must be applied; they are called MinScaleDenominator
and MaxScaleDenominator
. Let's use them!
Take the RoadsThematic.xml
file, make a copy to RoadsThematicScale.xml
, and 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 snippet:
<Name>RoadsThematicScale</Name>
Go to line 11 and replace the text inside the Title
element with the following code snippet:
<Title>Geoserver Beginners Guide: Roads thematic map with scale ranges</Title>
We want Interstate roads to appear at any scale, so we leave the first Rule
unchanged. Federal roads will appear only at 1:10,000,000 scale...
Change the font size
Change margin width
Change background colour