Layers & Styles

Understand how GeoServer separates data representation from visual rendering using Layers and Styles (SLD/SE).

Core Concept: In GeoServer, a Layer points to your data source, while a Style defines how that data is drawn. This decoupling allows you to apply multiple visual representations to the same dataset without duplicating data.

Layer Management

A Layer is a named reference to a dataset within a Workspace. Each layer has a unique name within its workspace and is associated with at least one default style.

Vector
world_borders
PostGIS / 1,240 features
Raster
landcover_tiff
GeoTIFF / 3 bands
WMS
usgs_topo
Remote WMS Proxy
GeoJSON
sensor_readings
File / Real-time

Creating a Layer

Layers are typically published automatically when you add a new feature type or coverage to a datastore. You can manage layer settings via the Web Admin interface or the REST API.

⚙️
Layer Configuration

Styling with SLD/SE

Styles in GeoServer are defined using the Styled Layer Descriptor (SLD) standard or the more powerful Symbolizer Encoding (SE) extension. SLD is an XML-based language that controls symbology, labeling, and rendering.

Tip: Use the built-in "Quick Style Editor" for simple color/size changes. For advanced cartography, author full SLD/SE XML or use the css-in-style plugin.
SLD 1.1.0
<!-- Polygon Style for World Borders -->
<StyledLayerDescriptor version="1.1.0" xmlns="http://www.opengis.net/sld">
  <NamedLayer>
    <Name>world_borders_poly</Name>
    <UserStyle>
      <Title>World Borders Default</Title>
      <FeatureTypeStyle>
        <Rule>
          <Name>BasePolygon</Name>
          <PolygonSymbolizer>
            <Fill>
              <CssParameter name="fill">#888888</CssParameter>
            </Fill>
            <Stroke>
              <CssParameter name="stroke">#ffffff</CssParameter>
              <CssParameter name="stroke-width">1.0</CssParameter>
            </Stroke>
          </PolygonSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

Style Preview

Visualizing how styles apply to layers before publishing:

Layer: world_borders | Style: polygon

Layer-Style Associations

Each layer can have one default style and multiple available styles. Clients requesting the layer via WMS can specify a different style name to alter the rendering.

Layer Default Style Available Styles Format
world_borders polygon polygon, line, dem SLD 1.1
landcover_tiff raster_color raster_color, gray SE
sensor_readings point point, point_cluster SLD 1.1

Performance Considerations