OpenGeo

OpenGeo Stack Workshop

Previous topic

Creating a New Line SLD

Next topic

Scale Depending Rendering with Styler

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.

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

    ../_images/styler_thematic1.jpg

    Running the Styler application

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

    ../_images/styler_thematic2.jpg

    Turning on the bay_area_transit_routes layer

  3. Activate the 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.

    ../_images/styler_thematic3.jpg

    Setting the bay_area_transit_routes layer to be styled

  4. In the Legend panel click the defaut style

    ../_images/styler_thematic4.jpg

    Opening the Style dialog

  5. In the Style dialog change the Name field to “Bus”.

  6. Click the Color field and change the color to green.

    ../_images/styler_thematic5.jpg

    Editing color

  7. Close the Color Picker dialog and click the Advanced tab.

    ../_images/styler_thematic6.jpg

    Opening the advanced styling tab

  8. Click the 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.

  9. Leave the value of the first drop down list as any.

  10. In the second drop down select the class attribute.

    ../_images/styler_thematic7.jpg

    Selecting the attribute for a condition

  11. In the third drop down select the = operator.

    ../_images/styler_thematic8.jpg

    Selecting the operator for a condition

  12. In the text field enter the text “Bus”

    ../_images/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.

  13. Click the Save button.

    ../_images/styler_thematic10.jpg

    Saving a style

  14. Add a new style by clicking the Add new button in the Legend panel:

    ../_images/styler_thematic11.jpg

    Adding a new style

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

    • Name: “Rail”
    • Color: grey
    • Condition: class = Rail
    ../_images/styler_thematic16.jpg

    Adding the Rail style

  16. Add another style with:

    • Name: “Ferry”
    • Color: blue
    • Condition: class = Ferry
    ../_images/styler_thematic17.jpg

    Adding the Ferry style

  17. 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 Shift and dragging the mouse to draw a desired viewport.

    ../_images/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 next section the style will be further improved with the addition of scale dependence.