.. _geoserver.styler.line_sld_create:

Creating a New Line SLD
-----------------------

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 <http://localhost:8080/geoserver/config/index.do>`_ navigate to :menuselection:`Data --> Style --> New`.

#. Enter "transit_routes_style" in the text field and click :guilabel:`New`.

   .. figure:: line_sld_create1.jpg

      Creating the transit_routes_style

#. In the :guilabel:`SLD Editor` enter the following XML:

   .. code-block:: 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.

   .. figure:: line_sld_create2.jpg

      Creating a basic line SLD

#. :guilabel:`Submit`, :guilabel:`Apply`, and :guilabel:`Save` changes.

#. Using skills learned in the :mod:`geoserver.basics` module, modify the default style of the :guilabel:`bay_area_transit_routes` feature type to the newly created :guilabel:`transit_routes_style`.

   .. figure:: line_sld_create3.jpg

      Changing the default style of the bay_area_transit_routes feature type 

#. Use the `Map Preview <http://localhost:8080/geoserver/mapPreview.do>`_ to preview the new style.

   .. figure:: line_sld_create4.jpg

      Previewing the bay_area_transit_routes layer with the transit_routes_style applied

At this point a new style is in place. In the :ref:`next <geoserver.styler.styler_thematic>` section the Styler application will be used to modify it.

