Skip to end of metadata
Go to start of metadata

Styled Layer Descriptor (SLD)

Overview

Geographic layers hosted by the MassGIS Web Mapping Services can be styled with instructions given in the GetMap request itself. This is called SLD or Styled Layer Descriptor. SLD is an OGC specification. While MassGIS provides a default style for each layer and sometimes other additional styles, not all possibilities can be pre-created. The user may require a new color (due to combining this layer with certain other layers). Or the user might have sensitive data on their server that they cannot share with MassGIS. The user requests a map and can color features (such as towns) based on an attribute (name or id number). The MassGIS web mapping server will dutifully return a map with such-and-such towns colored red, without needing to know why there were chosen. SLD can also substitute other graphic symbols for points, lines and polygon fills. SLD requests can be either URL or XML. SLD requests are longer than requests using MassGIS pre-made named styles, but due to the flexibility in creating maps the possibilities are enormous.

A Note on Colors

In SLD requests you'll see colors referred to using a hash mark: #, plus 6 letters or numbers.
These are hexadecimal colors. For example, #000000 is black, #FFFFFF is white.

Examples

The Point Example provides both URL and XML request format.

How do I create my own SLD?

Other SLD Tutorials on the Web

Page: GeoServer - SLD - Creating SLD Page: GeoServer - SLD - Point Example Page: GeoServer - SLD - Point Example Graduated Page: GeoServer - SLD - Point Example Labels Page: GeoServer - SLD - Point Example Labels Static Page: GeoServer - SLD - Point Example Labels - Rotation with Angle Page: GeoServer - SLD - Point Example Rules Page: GeoServer - SLD - Line Example Page: GeoServer - SLD - Line Example - Trains Page: GeoServer - SLD - Maps with Curved Labels Page: GeoServer - SLD - Polygon Example Page: GeoServer - SLD - Order of Drawing Features Page: GeoServer - SLD - Polygon Example as Points Page: GeoServer - SLD - Polygon Example Diagonal Graphic Page: GeoServer - SLD - Polygon Example Fill Graphics Page: GeoServer - SLD - Adding Space Around Graphic Fills Page: GeoServer - SLD - Polygon Example Hatching No Graphic Needed Page: GeoServer - SLD - Polygon Example Other Layers Page: GeoServer - SLD - Polygon Example Transparent Graphic Page: GeoServer - SLD - Polygon Example with Labels Page: GeoServer - SLD - Polygon Example with Outlines Page: GeoServer - SLD - Polygon Example with Stacked Labels Page: GeoServer - SLD - Inline Feature Page: GeoServer - SLD - Inline Feature Example 2 Page: GeoServer - SLD - Inline Feature Example 3 Page: GeoServer - SLD - Inline Feature Graphic Discussion Page: GeoServer - SLD - Graphics with Labels Inside Page: GeoServer - SLD - Reference to SLD File Page: GeoServer - SLD - division Function Page: GeoServer - SLD - dateFormat Function Page: GeoServer - SLD - strCapitalize Function Page: GeoServer - SLD - numberFormat Function Page: GeoServer - SLD - Transparent GIFs for Icons Page: GeoServer - SLD - Units of Measure Page: GeoServer - SLD - Complex Filter Example Page: GeoServer - SLD - Variable Substitution Page: GeoServer - SLD - Multi Point Example Centroid Labels