.. _geoserver.styler.styler_thematic:

Thematic Styling with Styler
----------------------------

Thematics is another very import aspect of cartography. This section covers the task of launching the Styler application and using it to create create a simple thematic style.

#. Navigate to http://localhost:8080/geoserver/www/styler/index.html in the web browser.

   .. figure:: styler_thematic1.jpg
      :width: 650

      Running the Styler application

#. In the :guilabel:`Layers` panel, turn off the :guilabel:`world_adm0` layer by unchecking the check box next to it. Turn on the :guilabel:`bay_area_transit_routes` layer by checking the check box next it.

   .. figure:: styler_thematic2.jpg

      Turning on the bay_area_transit_routes layer

#. Activate the :guilabel:`bay_area_transit_routes` layer for styling by selecting the radio button next to it

   .. note:: The **check boxes** are used control layer visibility. Any number of layers can be visible at one time. The **radio buttons** are used to set the layer to be styled. Only a single layer can be styled at once.

   .. figure:: styler_thematic3.jpg

      Setting the bay_area_transit_routes layer to be styled

#. In the :guilabel:`Legend` panel click the :guilabel:`defaut` style

   .. figure:: styler_thematic4.jpg

      Opening the **Style** dialog

#. In the :guilabel:`Style` dialog change the :guilabel:`Name` field to "Bus".

#. Click the :guilabel:`Color` field and change the color to green.

   .. figure:: styler_thematic5.jpg

      Editing color

#. Close the :guilabel:`Color Picker` dialog and click the :guilabel:`Advanced` tab.

   .. figure::  styler_thematic6.jpg

      Opening the advanced styling tab

#. Click the :guilabel:`Limit by condition` check box.

   .. note:: Limiting by condition applies a filter to a style restricting what parts of the layer the style applies to.  Such filters are usually based on a layer attribute value.

#. Leave the value of the first drop down list as :guilabel:`any`.

#. In the second drop down select the :guilabel:`class` attribute.

   .. figure:: styler_thematic7.jpg

      Selecting the attribute for a condition

#. In the third drop down select the :guilabel:`=` operator.

   .. figure:: styler_thematic8.jpg

      Selecting the operator for a condition

#. In the text field enter the text "Bus"

   .. figure:: styler_thematic9.jpg

      Specifying the value for a condition

   .. note:: The above filter specifies that only transit routes which are "Bus" routes should be matched.

#. Click the :guilabel:`Save` button.

   .. figure:: styler_thematic10.jpg

      Saving a style

#. Add a new style by clicking the :guilabel:`Add new` button in the :guilabel:`Legend` panel:

   .. figure:: styler_thematic11.jpg

      Adding a new style

#. Repeating steps 5 through 13 create a new style with: 

   * **Name**: "Rail"
   * **Color**: grey
   * **Condition**: class = Rail

   .. figure:: styler_thematic16.jpg

      Adding the Rail style

#. Add another style with:

   * **Name**: "Ferry"
   * **Color**: blue
   * **Condition**: class = Ferry

   .. figure:: styler_thematic17.jpg

      Adding the Ferry style

#. Zoom in closer to get a better look at the styles.

   .. note:: The map panel of Styler is a regular OpenLayers map. You can "rubber-band" zoom by holding :guilabel:`Shift` and dragging the mouse to draw a desired viewport. 

   .. figure:: styler_thematic18.jpg

      Viewing the styled bay_area_transit_routes layer

At this point a thematic style has been created with the Styler application. In the :ref:`next <geoserver.styler.styler_scale>` section the style will be further improved with the addition of scale dependence.


