OpenGeo

OpenGeo Stack Workshop

Previous topic

Thematic Styling with Styler

Next topic

Advanced Styling with SLD

Scale Depending Rendering with StylerΒΆ

The style created in the previous section lacks some scale rules. In a previous module scale dependence was added by editing XML directly. In this section scale dependence will be added via the Styler.

  1. Using the Zoom Slider on the left zoom to an approximate scale of 1:550,000.

    ../_images/styler_scale1.jpg

    Zooming with the slider

    Note

    At any time the current scale can be viewed by hovering over the zoom slider. This can be useful when setting up scale dependent style rules.

    ../_images/styler_scale2.jpg
  2. Edit the Bus style by clicking on the rule in the Legend panel.

  3. On the Basic tab change the Name to “Bus > 155K”

    ../_images/styler_scale3.jpg

    Changing the name of a style

  4. On the Advanced tab click the add condition button

    ../_images/styler_scale4.jpg

    Adding a condition to a style filter

  5. Set the Match drop down to all.

  6. Add the condition “shape_leng > 50000” and save the style.

    Note

    The “shape_leng” represents the overall length of the transit route. Supplementing the scale filter with this conditional filter creates the affect of longer transit routes showing up at larger scales.

    ../_images/styler_scale5.jpg

    Filtering the bay_area_bus_routes layer

  7. Zoom in two levels to an approximate scale of 1:135,000.

  8. In the Legend Panel click the Add new button.

  9. Add a new style rule with:

    • Name: “Bus 155K - 35K”
    • Color: Same as Bus > 155K style (green).
    • Min scale limit: “35000”
    • Max scale limit: “155000”
    • Condition: Match all of:
      • “class = Bus”
      • “shape_leng > 20000”
      • “shape_leng < 50000”
    ../_images/styler_scale6.png

    Adding a style at the 155K - 35K scale

  10. Save the Bus 155 - 35k style.

  11. Add a third style rule that similar to the one added in steps 8 through 10 with:

    • Name: “Bus < 35K”
    • Color: Same as Bus > 155K style (green).
    • Max Scale: “35000”
    • Condition: Match all of:
      • “class = Bus”
      • “shape_leng < 20000”
    ../_images/styler_scale7.png

    Adding a style at the < 35K scale

  12. Zoom the map in and out to verify the scale dependent rules.

    ../_images/styler_scale8.jpg

    Viewing style change based on scale

Up to this point SLD styles have been created by editing XML directly, and via the Styler application. In the next module an SLD style will be created with a combination of the two.