Styling in GeoServer

Krishna G. Lodha

Introduction to GeoServer

What is GeoServer?

  • Open-source server for sharing geospatial data.
  • Supports OGC standards (WMS, WFS, WCS, WMTS, WPS).

GeoServer

Key features and benefits.

  • Cross-platform compatibility.
    • Tomcat .war file
    • Platform independent binary .zip is available
    • Docker Image available
  • High scalability and flexibility for enterprise GIS applications.

Ways of styling

  • QGIS
  • SLD ( Default )
  • CSS
  • YSLD
  • MBStyle

How Styles are structured

  • Name
  • Rule
    • Title
    • Filter
    • Scale
    • GeometrySymbolizer
      • Stroke
      • Fill
  • Legend

QGIS Demo

QGIS Save style

SLD Demo

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
  xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd"
  xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc"
  xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <NamedLayer>
    <Name></Name>
    <UserStyle>
      <Title>yellow square point style</Title>
      <FeatureTypeStyle>
        <Rule>
          <Title>yellow point</Title>
          <PointSymbolizer>
            <Graphic>
              <Mark>
                <WellKnownName>square</WellKnownName>
                <Fill>
                  <CssParameter name="fill">#ffff00</CssParameter>
                </Fill>
              </Mark>
              <Size>6</Size>
            </Graphic>
          </PointSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

YSLD Demo

title: 'Building'
feature-styles:
- name: name
  rules:
  - title: Buildings
    symbolizers:
    - polygon:
        fill-color: '#D9D0C9'
        stroke-width: 1
        stroke-color: '#D9D0C9'
        fill-opacity: 0.7

OSM Styling demo

Shapefile Data for demo is downloaded from https://www.geofabrik.de/

  • Polygon Demo
  • Line Demo
  • Point Demo
  • Conversion SLD -> YSLD

Geoserver Cohort

  • 10 people batch
  • Starting on 5th May 2025
  • 1 year community access
  • lifetime course access

Interested ?

https://bit.ly/geoserver-cohort

Course QR

Testimonials