Before using the Styler application a new style must be first created for the layer being styled. This section covers the task of creating a new line style SLD from scratch, reiterating over topics covered in previous modules.
From the Config Page navigate to Data ‣ Style ‣ New.
Enter “transit_routes_style” in the text field and click New.
Creating the transit_routes_style
In the SLD Editor enter the following XML:
<StyledLayerDescriptor version="1.0.0"
xmlns="http://www.opengis.net/sld"
xmlns:ogc="http://www.opengis.net/ogc">
<NamedLayer>
<Name>Transit Routes</Name>
<UserStyle>
<FeatureTypeStyle>
<Rule>
<LineSymbolizer>
<Stroke/>
</LineSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
Note
The above XML snippet creates a <LineSymbolizer> with all the default values. This will result in a blank link 1 pixel wide.
Creating a basic line SLD
Submit, Apply, and Save changes.
Using skills learned in the geoserver.basics module, modify the default style of the bay_area_transit_routes feature type to the newly created transit_routes_style.
Changing the default style of the bay_area_transit_routes feature type
Use the Map Preview to preview the new style.
Previewing the bay_area_transit_routes layer with the transit_routes_style applied
At this point a new style is in place. In the next section the Styler application will be used to modify it.