Geoserver

Geoserver

Overview

An open source software server written in Java that allows users to share and edit geospatial data.

Web Admin Interface

Quick View

About & Status

Server Status shows a summary of server configuration parameters and run-time status.

GeoServer Logs shows the GeoServer log output. This is useful for determining errors without having to leave the browser.

Contact Information sets the public contact information available in the Capabilities document of the WMS server.

About GeoServer section provides links to the GeoServer documentation, homepage and bug tracker.

This section provides access to GeoServer diagnostic and configuration tools, and can be particularly useful for debugging.

Data

Layer Preview provides links to layer previews in various output formats, including the common OpenLayers and KML formats.

Workspaces displays a list of workspaces. Also shows which workspace is the default for the server.

Stores displays a list of stores. Details include the workspace associated with the store, the type of store (data format), and whether the store is enabled.

Layers displays a list of layers. Details include the workspace and store associated with the layer, whether the layer is enabled, and the spatial reference system (SRS) of the layer.

Layer Groups displays a list of layer groups. Details include the associated workspace.

Styles displays a list of styles. Details include the associated workspace.

This section contains configuration options for all the different data-related settings

Services

Web Map Service (WMS) manages metadata, resource limits, SRS availability, and other data-specific output for WMS.

Web Map Tile Service (WMTS) manages metadata for WMTS.

Web Feature Service (WFS) manages metadata, feature publishing, service level options, and data-specific output for WFS.

Web Coverage Service (WCS) manages metadata, resource limits, and SRS availability for WCS.
 

This section is for configuring the services published by GeoServer

Services

Web Map Service (WMS) supports requests for map images (and other formats) generated from geographical data.

 

Web Feature Service (WFS) supports requests for geographical feature data (with vector geometry and attributes).

 

Web Coverage Service (WCS) supports requests for coverage data (rasters).

Settings

Global Settings configures messaging, logging, character and proxy settings for the entire server.

Image Processing configures several JAI parameters, used by both WMS and WCS operations.

Raster Access configures settings related to loading and publishing coverages.

This section contains configuration settings that apply to the entire server

Tile Caching

Tile Layers shows which layers in GeoServer are also available as tiled (cached) layers.

Caching Defaults sets the global options for the caching service.

Gridsets shows all available gridsets for the tile caches.

Disk Quota sets the options for tile cache management on disk, including strategies to reduce file size when necessary.

BlobStores manages the different blobstores (tile cache sources) known to the embedded GeoWebCache.

This section configures the embedded GeoWebCache

Security

Settings manages high-level options for the security subsystem.

Authentication manages authentication filters, filter chains, and providers.

Passwords manages the password policies for users and the master (root) account.

Users, Groups, Roles manages the users, groups, and roles, and how they are all associated with each other.

Data manages the data-level security options, allowing workspaces and layers to be restricted by role.

Services manages the service-level security options, allowing services and operations to be restricted by role.

This section configures the built-in security subsystem

Demos & Tools

Demos contains links to example WMS, WCS, and WFS requests for GeoServer as well as a listing all SRS info known to GeoServer.

Tools contains administrative tools. By default, the only tool is the Catalog Bulk Load Tool, which can bulk copy test data into the catalog.

Getting Started

Basic

  1. Data Preparation
  2. Create Workspace
  3. Create Store
  4. Publish Layer
  5. Preview Layer

Basic things to know:

1. Data Preparation

  • Data Specification: Layers, Projection, Field name, Field type etc.
  • In our case, the data format is Shapefile (.shp)

2. Create Workspace

  • A container used to group similar layers together.
  • Also used to differentiate between Geoserver services.
  • Eg. Malaysia_WMS, Malaysia_WFS
  • Name - Identifier describing your project (not more than 10 characters)
  • Namespace URI (Uniform Resource Identifier) - URL associated with your workspace (The URI doesn't need to resolve to an actual valid web address)
  • Services - Allowed services for this workspace and its data/layers

3. Create Store (1/2)

  • The store tells GeoServer how to connect to the shapefile.
  • In order to Create Layer, user must established a connection to where they store the Database.
  • Data supported by Geoserver:
    • Vector
    • Raster
  • For LBD, we used PostGIS as our Data Source.

3. Create Store (2/2)

Required Info:

  • Workspace - Select existing workspace
  • Name - Name of the Store

 

Connection Parameters:

  • dbtype - The type of database
  • host/port - IPaddress:port of the Postgis location
  • database - Name of the database created in Postgis

4. Create Layer (1/2)

2 ways to create layers in Geoserver:

  1. SQL View
  2. Direct Publish

SQL View

Direct

4. Create Layer (2/2)

Data

  • Name*
  • Title
  • Coordinate Ref System (CRS)*
  • Bounding Box*
  • Feature Type Details*
  • CQL Filter*

Publishing

  • WMS Settings
    • Style etc.
  • WFS Settings
    • Max Request etc.

Dimensions (not used)

  • Time
  • Elevation

Tile Caching

  • Configuration
    • Enable/Disable*
    • Metatiling Factors
    • Tile Image Format
    • Gridsets

5. Preview Layer

  • In order to verify that the layer is published correctly, user can preview the layer.
  • An OpenLayers map will load in a new tab and display the shapefile data with the default line style or own created style.

Default Line Style

TM LBD Style

Styling

What is Styles?

  • Styles are used to control the appearance of geospatial data.
  • Geospatial data has no intrinsic visual component. In order to see data, it must be styled.
  • Styling specifies color, thickness, and other visible attributes used to render data on a map.

Styling Types

Geoserver can serve 3 classes of shapes of vector data:

 

  • Line - one dimensional shapes, is the simplest, as it has only the edge to style (also known as “stroke”).
  • Polygon - two dimensional shapes, have an edge (stroke”) and an inside (also known as a “fill”), both of which can be styled differently.
  • Point - even though it lacks dimension, it has both an edge and a fill (not to mention a size) that can be styled.

 

Each shape can be styled with Label

 

And with just that, you can start create your own Map!

Styling Format

  • SLD Styling (Default)
  • Generate SLD with QGIS 
  • CSS Styling (Extension)
  • YSLD Styling (Extension)
  • MBStyle Styling (Extension)

Learn to style map in Geoserver by using 1 of these 5 methods:

1. SLD Styling

  • In GeoServer, default styling format is accomplished using a markup language called Styled Layer Descriptor, or SLD for short.
  • SLD is an XML-based markup language and is very powerful, although somewhat complex.

 

A good way to learn about SLD is to study styling examples.

Refer: >> SLD Styling <<

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
    xsi:schemaLocation="http://www.opengis.net/sld 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>Simple point</Name>
    <UserStyle>
      <Title>GeoServer SLD: Simple point</Title>
      <FeatureTypeStyle>
        <Rule>
          <PointSymbolizer>
            <Graphic>
              <Mark>
                <WellKnownName>circle</WellKnownName>
                <Fill>
                  <CssParameter name="fill">#FF0000</CssParameter>
                </Fill>
              </Mark>
              <Size>6</Size>
            </Graphic>
          </PointSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

Eg: Simple POINT using SLD styling

2. Generate SLD Styling with QGIS

Don't have time to study and create SLD? Use QGIS.

  • Styles generated with QGIS can then be exported (with limitations) to SLD for usage with GeoServer.
  • For vector data QGIS exports SLD 1.1 styles that can be read by GeoServer.
  • In order to get the suitable results it’s important to use QGIS 3.0 or newer, and GeoServer 2.13.x or newer.

 

Refer: >> QGIS SLD <<

3. CSS Styling

  • The CSS extension uses a CSS-derived language instead of SLD.
  • These CSS styles are internally converted to SLD, which is then used as normal by GeoServer.
  • CSS is not a part of GeoServer by default, but is available as an extension.

 

Refer: >> CSS Styling <<

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
    xsi:schemaLocation="http://www.opengis.net/sld 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>Simple point</Name>
    <UserStyle>
      <FeatureTypeStyle>
        <Rule>
          <PointSymbolizer>
            <Graphic>
              <Mark>
                <WellKnownName>circle</WellKnownName>
                <Fill>
                  <CssParameter name="fill">#FF0000</CssParameter>
                </Fill>
              </Mark>
              <Size>6</Size>
            </Graphic>
          </PointSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>
 * {
   mark: symbol(circle);
   mark-size: 6px;
   :mark {
     fill: #FF0000;
   }
 }

4. YSLD Styling

  • YSLD is a YAML based language which closely matches the structure of SLD.
  • YSLD is not a part of GeoServer by default, but is available as an optional install or extension.

 

Refer: >> YSLD Styling <<

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
    xsi:schemaLocation="http://www.opengis.net/sld 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>Simple point</Name>
    <UserStyle>
      <FeatureTypeStyle>
        <Rule>
          <PointSymbolizer>
            <Graphic>
              <Mark>
                <WellKnownName>circle</WellKnownName>
                <Fill>
                  <CssParameter name="fill">#FF0000</CssParameter>
                </Fill>
              </Mark>
              <Size>6</Size>
            </Graphic>
          </PointSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>
title: 'YSLD : Simple Point'
feature-styles:
- name: Simple Point
  rules:
  - symbolizers:
    - point:
        size: 6
        symbols:
        - mark:
            shape: circle
            fill-color: '#FF0000'

5. MBStyle Styling

  • MBStyle is a JSON based language which can be converted to SLD.
  • MBStyle is not a part of GeoServer by default, but is available as an optional install or extension.

 

Refer: >> MBStyle Styling <<

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
    xsi:schemaLocation="http://www.opengis.net/sld 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>Simple point</Name>
    <UserStyle>
      <FeatureTypeStyle>
        <Rule>
          <PointSymbolizer>
            <Graphic>
              <Mark>
                <WellKnownName>circle</WellKnownName>
                <Fill>
                  <CssParameter name="fill">#FF0000</CssParameter>
                </Fill>
              </Mark>
              <Size>6</Size>
            </Graphic>
          </PointSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>
{
  "version": 8,
  "name": "simple-point",
  "layers": [
    {
      "id": "point",
      "type": "circle",
      "paint": {
        "circle-radius": 6,
        "circle-color": "#FF0000",
        "circle-pitch-scale": "map"
      }
    }
  ]
}

LBD Map Styles

  • LBD map is made of 56 styles combined.
  • All styles are using SLD format.

Example 1 : State Polygon & Label Styling

<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns:se="http://www.opengis.net/se">
  <NamedLayer>
    <se:Name>State</se:Name>
    <UserStyle>
      <se:Name>State</se:Name>

      <se:FeatureTypeStyle>

        <se:Rule>

          <se:Name>State_Polygon</se:Name>

          <se:PolygonSymbolizer>

            <se:Fill>
              <se:SvgParameter name="fill">#f9f9f9</se:SvgParameter>
            </se:Fill>

          </se:PolygonSymbolizer>

        </se:Rule>

      </se:FeatureTypeStyle>

    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

Polygon

<sld:UserStyle xmlns="http://www.opengis.net/sld" xmlns:sld="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">
  <sld:Name>Default Styler</sld:Name>
  <sld:Title/>
  <sld:FeatureTypeStyle>
    <sld:Name>name</sld:Name>
    
    <!-- Mid Label -->
    <sld:Rule>
      
      <Name>Mid Label</Name>
      
      <MinScaleDenominator>3000000</MinScaleDenominator>
      <MaxScaleDenominator>8000000</MaxScaleDenominator>
      
      <sld:TextSymbolizer>
        
        <sld:Geometry>          
          <ogc:Function name="centroid">
            <ogc:PropertyName>geom</ogc:PropertyName>
          </ogc:Function>          
        </sld:Geometry>
        
        <sld:Label>          
          <ogc:PropertyName>state_name</ogc:PropertyName>
        </sld:Label>
        
        
        <sld:Font>
          <sld:CssParameter name="font-family">DejaVu Sans</sld:CssParameter>
          <sld:CssParameter name="font-size">14</sld:CssParameter>
          <sld:CssParameter name="font-style">bold</sld:CssParameter>
          <sld:CssParameter name="font-weight">normal</sld:CssParameter>
        </sld:Font>
        
        <sld:Halo>
          <sld:Radius>1.5</sld:Radius>
          <sld:Fill><sld:CssParameter name="fill">#FFFFFF</sld:CssParameter></sld:Fill>
        </sld:Halo>
        
        <sld:Fill>
          <sld:CssParameter name="fill">#734b39</sld:CssParameter>
        </sld:Fill>
        
        <sld:LabelPlacement>
          <sld:PointPlacement>
            <sld:AnchorPoint>
              <sld:AnchorPointX>0.5</sld:AnchorPointX>
              <sld:AnchorPointY>0.5</sld:AnchorPointY>
            </sld:AnchorPoint>
            <sld:Displacement>
              <sld:DisplacementX>0</sld:DisplacementX>
              <sld:DisplacementY>5</sld:DisplacementY>
            </sld:Displacement>
          </sld:PointPlacement>
        </sld:LabelPlacement>
        
        <sld:VendorOption name="autoWrap">15</sld:VendorOption>
        <sld:VendorOption name="maxDisplacement">30</sld:VendorOption>
        <sld:VendorOption name="charSpacing">0.5</sld:VendorOption>
        
      </sld:TextSymbolizer>
      
    </sld:Rule>
    
  </sld:FeatureTypeStyle>
  
</sld:UserStyle>

Label

Example 2 : Street Line & Label Styling

<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns:se="http://www.opengis.net/se">
  <NamedLayer>
    <se:Name>Street</se:Name>
    <UserStyle>
      <se:Name>Street Line</se:Name>


      <!-- 34K 34K 34K 34K 34K 34K 34K 34K 34K 34K -->


      <!-- HIGHWAY Outline 34K -->
      <se:FeatureTypeStyle>
        <se:Rule>
          <se:Name>HIGHWAY Outline 34K</se:Name>

          <MaxScaleDenominator>50000</MaxScaleDenominator>
          <MinScaleDenominator>25000</MinScaleDenominator>

          <se:Description><se:Title>Hway Low</se:Title></se:Description>

          <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
            <ogc:PropertyIsEqualTo>
              <ogc:PropertyName>street_cl</ogc:PropertyName>
              <ogc:Literal>1</ogc:Literal>
            </ogc:PropertyIsEqualTo>
          </ogc:Filter>

          <se:LineSymbolizer>
            <se:Stroke>
              <se:SvgParameter name="stroke">#b2924e</se:SvgParameter>
              <se:SvgParameter name="stroke-width">5</se:SvgParameter>
              <se:SvgParameter name="stroke-linejoin">mitre</se:SvgParameter>
              <se:SvgParameter name="stroke-linecap">round</se:SvgParameter>
            </se:Stroke>
          </se:LineSymbolizer>

        </se:Rule>

        <se:VendorOption name="sortBy">street_ele</se:VendorOption>
        <se:VendorOption name="sortByGroup">roads</se:VendorOption>

      </se:FeatureTypeStyle>


      <!-- HIGHWAY Fill 34K -->
      <se:FeatureTypeStyle>
        <se:Rule>
          <se:Name>HIGHWAY Fill 34K</se:Name>

          <MaxScaleDenominator>50000</MaxScaleDenominator>
          <MinScaleDenominator>25000</MinScaleDenominator>

          <se:Description><se:Title>Hway Low</se:Title></se:Description>

          <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
            <ogc:PropertyIsEqualTo>
              <ogc:PropertyName>street_cl</ogc:PropertyName>
              <ogc:Literal>1</ogc:Literal>
            </ogc:PropertyIsEqualTo>
          </ogc:Filter>

          <se:LineSymbolizer>
            <se:Stroke>
              <se:SvgParameter name="stroke">#ffe68c</se:SvgParameter>
              <se:SvgParameter name="stroke-width">3</se:SvgParameter>
              <se:SvgParameter name="stroke-linejoin">mitre</se:SvgParameter>
              <se:SvgParameter name="stroke-linecap">round</se:SvgParameter>
            </se:Stroke>
          </se:LineSymbolizer>

        </se:Rule>

        <se:VendorOption name="sortBy">street_ele</se:VendorOption>
        <se:VendorOption name="sortByGroup">roads</se:VendorOption>

      </se:FeatureTypeStyle>


    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

Line

<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns:se="http://www.opengis.net/se">
  <NamedLayer>
    <se:Name>Street</se:Name>
    <UserStyle>
      <se:Name>Street Label</se:Name>


      <!-- Highway -->

      <!-- Highway Mid Level-->
      <se:FeatureTypeStyle>
        <se:Rule>
          <se:Name>Hway Mid</se:Name>

          <MaxScaleDenominator>200000</MaxScaleDenominator>
          <MinScaleDenominator>20000</MinScaleDenominator>

          <se:Description><se:Title>Hway Mid</se:Title></se:Description>

          <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
            <ogc:PropertyIsEqualTo>
              <ogc:PropertyName>street_cl</ogc:PropertyName>
              <ogc:Literal>1</ogc:Literal>
            </ogc:PropertyIsEqualTo>
          </ogc:Filter>

          <se:TextSymbolizer>

            <se:Label>
              <ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace">

                <ogc:PropertyName>street_na</ogc:PropertyName>

                <ogc:Literal>^Lbr</ogc:Literal><ogc:Literal>Lebuhraya</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>^Jln</ogc:Literal><ogc:Literal>Jalan</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>^Sun</ogc:Literal><ogc:Literal>Susuran</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>^Jam</ogc:Literal><ogc:Literal>Jambatan</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>Ldp.</ogc:Literal><ogc:Literal>LDP</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>Kesas.</ogc:Literal><ogc:Literal>KESAS</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>Npe.</ogc:Literal><ogc:Literal>NPE</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>Mex.</ogc:Literal><ogc:Literal>MEX</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>Plus.</ogc:Literal><ogc:Literal>PLUS</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>Duke.</ogc:Literal><ogc:Literal>DUKE</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>Lekas.</ogc:Literal><ogc:Literal>LEKAS</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>.*Baru Lembah Klang.*</ogc:Literal><ogc:Literal>NKVE</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>.*Lembah Klang Selatan.*</ogc:Literal><ogc:Literal>SKVE</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>.*Utara-Selatan Lingkaran Tengah.*</ogc:Literal><ogc:Literal>ELITE</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>.*Utara-Selatan.*</ogc:Literal><ogc:Literal>PLUS</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>.*Baru Pantai.*</ogc:Literal><ogc:Literal>NPE</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>.*Damansara-Puchong.*</ogc:Literal><ogc:Literal>LDP</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>Sungai Besi.*</ogc:Literal><ogc:Literal>Besraya</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>.*Kajang-Seremban.*</ogc:Literal><ogc:Literal>LEKAS</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>.*Kemuning.*</ogc:Literal><ogc:Literal>LKSA</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>.*Duta-Ulu Kelang.*</ogc:Literal><ogc:Literal>DUKE</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>.*Bertingkat Ampang-Kuala Lumpur.*</ogc:Literal><ogc:Literal>AKLEH</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>.*Lingkaran Tengah 2.*</ogc:Literal><ogc:Literal>MRR2</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>.*Shah Alam.*</ogc:Literal><ogc:Literal>KESAS</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>.*Kuala Lumpur-Kuala Selangor.*</ogc:Literal><ogc:Literal>LATAR</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>Skve.</ogc:Literal><ogc:Literal>SKVE</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>Nkve.</ogc:Literal><ogc:Literal>NKVE</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>Bee.</ogc:Literal><ogc:Literal></ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>Mrr2.</ogc:Literal><ogc:Literal>MRR2</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>Akleh.</ogc:Literal><ogc:Literal>AKLEH</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>Eli$</ogc:Literal><ogc:Literal>ELITE</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>Elite.</ogc:Literal><ogc:Literal>ELITE</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>Lksa.</ogc:Literal><ogc:Literal>LKSA</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>.*Maju.*</ogc:Literal><ogc:Literal>MEX</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>.*Lpt.*</ogc:Literal><ogc:Literal>LPT</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>.*Edl.*</ogc:Literal><ogc:Literal>EDL</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function> 
                <ogc:Literal>.*Borr.*</ogc:Literal><ogc:Literal>BORR</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>.*Spdh.*</ogc:Literal><ogc:Literal>SPDH</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>.*Csr.*</ogc:Literal><ogc:Literal>CSR</ogc:Literal><ogc:Literal>true</ogc:Literal>
              </ogc:Function>

            </se:Label>

            <se:Font>
              <se:CssParameter name="font-family">SansSerif.plain</se:CssParameter>
              <se:CssParameter name="font-size">10.5</se:CssParameter>
              <se:CssParameter name="font-weight">normal</se:CssParameter>
            </se:Font>

            <se:Halo>
              <se:Radius>1.5</se:Radius>
            </se:Halo>

            <se:LabelPlacement>
              <LinePlacement/>
            </se:LabelPlacement>

            <se:VendorOption name="followLine">true</se:VendorOption>
            <se:VendorOption name="maxAngleDelta">30</se:VendorOption>
            <se:VendorOption name="maxDisplacement">400</se:VendorOption>
            <se:VendorOption name="repeat">300</se:VendorOption>
            <se:VendorOption name="group">yes</se:VendorOption>

          </se:TextSymbolizer>

        </se:Rule>
      </se:FeatureTypeStyle>

Label

Example 3 : POI Point & Label Styling

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0" 
                       xsi:schemaLocation="http://www.opengis.net/sld 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>POI</Name>
    <UserStyle>

      <FeatureTypeStyle>

        <Rule>

          <Name>Sekolah</Name>

          <MinScaleDenominator>1</MinScaleDenominator>
          <MaxScaleDenominator>5000</MaxScaleDenominator>

          <PointSymbolizer>

            <Graphic>
              <ExternalGraphic>
                <OnlineResource xlink:type="simple" xlink:href="http://localhost:8080/POI_Icon/school.png" />
                <Format>image/png</Format>
              </ExternalGraphic>
              <Size>16</Size>
            </Graphic>

          </PointSymbolizer>

          <TextSymbolizer>

            <Label>
              <ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace"><ogc:Function name="strReplace">

                <ogc:PropertyName>place_na</ogc:PropertyName>

                <ogc:Literal>Sk</ogc:Literal><ogc:Literal>SK</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>Smk</ogc:Literal><ogc:Literal>SMK</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>Smjk</ogc:Literal><ogc:Literal>SMJK</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>Sm</ogc:Literal><ogc:Literal>SM</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>Srjk</ogc:Literal><ogc:Literal>SRJK</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>Srk</ogc:Literal><ogc:Literal>SRK</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>Sjk</ogc:Literal><ogc:Literal>SJK</ogc:Literal><ogc:Literal>true</ogc:Literal>
                </ogc:Function>
                <ogc:Literal>Elc</ogc:Literal><ogc:Literal>ELC</ogc:Literal><ogc:Literal>true</ogc:Literal>
              </ogc:Function>              
            </Label>

            <Font>
              <CssParameter name="font-family">SansSerif</CssParameter>
              <CssParameter name="font-weight">bold</CssParameter>
              <CssParameter name="font-size">9.5</CssParameter>
            </Font>

            <Halo>
              <Radius>1.5</Radius>
            </Halo>

            <LabelPlacement>
              <PointPlacement>
                <AnchorPoint>
                  <AnchorPointX>0.0</AnchorPointX>
                  <AnchorPointY>0.0</AnchorPointY>
                </AnchorPoint>
                <Displacement>
                  <DisplacementX>-40</DisplacementX>
                  <DisplacementY>7</DisplacementY>
                </Displacement>
              </PointPlacement>
            </LabelPlacement>

            <Fill>
              <CssParameter name="fill">#606312</CssParameter>
            </Fill>

            <VendorOption name="autoWrap">50</VendorOption>
            <VendorOption name="maxDisplacement">45</VendorOption>
            <VendorOption name="spaceAround">10</VendorOption>

          </TextSymbolizer>

        </Rule>

      </FeatureTypeStyle>

    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

Point & Label

Filtering

Type of Filtering

  • SQL View
  • CQL/ECQL Filter
  • XML-based SLD Filter

1. SQL View/Filter

  • SQL View allow executing a custom SQL query on each request to the layer.
  • This avoids the need to create a database view for complex queries.
SELECT
place_na AS poi_name,
tel_no,
url AS website,
lot_number AS lot_no,
house_num AS house_no,
buildingna AS building_name,
landmarkna AS landmark_name,
street_t AS street_type,
street_na AS street_name,
postal_num AS postcode,
section_na AS section_name,
city_name,

CASE 
WHEN state_code='JH' THEN 'JOHOR' 
WHEN state_code='KD' THEN 'KEDAH'
WHEN state_code='KN' THEN 'KELANTAN'
WHEN state_code='MK' THEN 'MELAKA'
WHEN state_code='NS' THEN 'NEGERI SEMBILAN'
WHEN state_code='PH' THEN 'PAHANG'
WHEN state_code='PP' THEN 'PULAU PINANG'
WHEN state_code='PK' THEN 'PERAK'
WHEN state_code='PS' THEN 'PERLIS'
WHEN state_code='SL' THEN 'SELANGOR'
WHEN state_code='TG' THEN 'TERENGGANU'
WHEN state_code='SB' THEN 'SABAH'
WHEN state_code='SW' THEN 'SARAWAK'
WHEN state_code='WP' THEN 'WILAYAH PERSEKUTUAN'
WHEN state_code='LB' THEN 'LABUAN'
ELSE 'Other'
END AS state_name,

geom

FROM ml_poi

WHERE 
poi_code NOT LIKE 'GSML%' AND poi_code NOT LIKE 'TMEX%' AND 
poi_code NOT LIKE 'PFPH%' AND poi_code NOT LIKE 'PFPT%' AND
poi_code NOT LIKE 'PFMP%' AND poi_code NOT LIKE 'PLAD%' AND 
poi_code NOT LIKE 'PLBB%' AND poi_code NOT LIKE 'PLBG%' AND 
poi_code NOT LIKE 'PLCT%' AND poi_code NOT LIKE 'PLID%' AND 
poi_code NOT LIKE 'PLLM' AND poi_code NOT LIKE 'PLLMBB' AND 
poi_code NOT LIKE 'PLLMOT' AND poi_code NOT LIKE 'PLRAKG' AND 
poi_code NOT LIKE 'PLRATM' AND poi_code NOT LIKE 'PLRABW' AND 
poi_code NOT LIKE 'PLRAOT' AND poi_code NOT LIKE 'TRKM%' AND 
poi_code NOT LIKE 'GSDP%' AND poi_code NOT LIKE 'GSIMLB' AND 
poi_code NOT LIKE 'GSPLAD' AND poi_code NOT LIKE 'GSMNMI' AND 
poi_code NOT LIKE 'GSMNDE' AND poi_code NOT LIKE 'MDHCPC'

Example:

SQL View for layer - WFS_POI

More: >> SQL View <<

2. CQL/ECQL Filter

  • CQL (Common Query Language) is a query language created by the OGC.
  • Unlike the XML-based Filter Encoding language, CQL is written using a familiar text-based syntax.
  • CQL has some limitations. For example it cannot encode id filters, and it requires an attribute to be on the left side of any comparison operator.
  • For this reason, GeoServer provides an extended version of CQL called ECQL (Extended CQL).
  • ECQL removes the limitations of CQL, providing a more flexible language with stronger similarities with SQL.

Example:

To create new layer where the condition is excluding all states except Kuala Lumpur

More: >> CQL/ECQL Filter <<

3. XML-SLD Filter

  • GeoServer provides many different kinds of XML Filter functions, covering a wide range of functionality including mathematics, string formatting, and geometric operations.

Example:

Using String function (strReplace) to return the string with the pattern replaced with the given replacement text.

More: >> XML Filter <<

<sld:Label>

  <ogc:Function name="strReplace">
  <ogc:Function name="strReplace">
  <ogc:Function name="strReplace">
  <ogc:Function name="strReplace">

  <ogc:PropertyName>building_n</ogc:PropertyName>

  <ogc:Literal>Klcc</ogc:Literal><ogc:Literal>KLCC</ogc:Literal><ogc:Literal>true</ogc:Literal></ogc:Function>
  <ogc:Literal>Klia</ogc:Literal><ogc:Literal>KLIA</ogc:Literal><ogc:Literal>true</ogc:Literal></ogc:Function>
  <ogc:Literal>Tnb</ogc:Literal><ogc:Literal>TNB</ogc:Literal><ogc:Literal>true</ogc:Literal></ogc:Function>
  <ogc:Literal>Tudm</ogc:Literal><ogc:Literal>TUDM</ogc:Literal><ogc:Literal>true</ogc:Literal></ogc:Function>

  <![CDATA[
]]><ogc:PropertyName>building_2</ogc:PropertyName>         

</sld:Label>

SLD Extensions

GeoServer provides a number of vendor-specific extensions to SLD 1.0.

Although not portable to other applications, these extensions make styling more powerful and concise and allow for the generation of better-looking maps.

SLD Extensions

  • Geometry Transformation
  • Graphic Symbology
  • Specifying Symbolizer Sizes in Ground Units
  • Z-Ordering

More: >> SLD Extensions <<

1. Geometry Transformation

  • The expression can contain filter functions that manipulate geometries by transforming them into something different.
  • It can be used to do things such as extracting line vertices or endpoints, offsetting polygons, or buffering geometries.

More: >> Geom Transformation <<

<StyledLayerDescriptor version="1.0.0" 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"
  xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">
  <NamedLayer>
    <Name>Building 3D Polygon</Name>
    <UserStyle>
      <Title>Building 3D polygon style</Title>
      
      	<FeatureTypeStyle>
          <Rule>
            <Name>Wall</Name>
            <MaxScaleDenominator>10000</MaxScaleDenominator>
            <PolygonSymbolizer>
              <Geometry>
                <ogc:Function name="isometric">
                  <ogc:PropertyName>geom</ogc:PropertyName>
                  <ogc:Literal>0.00010</ogc:Literal>
                </ogc:Function>
              </Geometry>
              <Fill>
                <CssParameter name="fill">#c9c9c9</CssParameter>
                <CssParameter name="fill-opacity">0.45</CssParameter>
              </Fill>
              <Stroke>
                <CssParameter name="stroke">#c9c9c9</CssParameter>
              </Stroke>
            </PolygonSymbolizer>
          </Rule>
		</FeatureTypeStyle>
      
      	<FeatureTypeStyle>
          <Rule>
            <Name>Roof</Name>
            <MaxScaleDenominator>10000</MaxScaleDenominator>
            <PolygonSymbolizer>
              <Geometry>
                 <ogc:Function name="offset">
                    <ogc:PropertyName>geom</ogc:PropertyName>
                    <ogc:Literal>0</ogc:Literal>
                    <ogc:Literal>0.00010</ogc:Literal>
                 </ogc:Function>
              </Geometry>
              <Fill>
                <CssParameter name="fill">#fdfdfd</CssParameter>
                <CssParameter name="fill-opacity">0.80</CssParameter>
              </Fill>
              <Stroke>
                <CssParameter name="stroke">#c9c9c9</CssParameter>
              </Stroke>
            </PolygonSymbolizer>
          </Rule>
		</FeatureTypeStyle>

    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

Example:

Function 'Isometric' & 'Offset' to generate 3D Building

2. Graphic Symbology

  • Graphic contains either a Mark or an ExternalGraphic element.
  • Mark are pure vector symbols whose geometry is predefined but with stroke and fill defined in the SLD itself.
  • External Graphics are external files (such as PNG images or SVG graphics) that contain the shape and color information defining how to render a symbol.
  • Both are fixed strings.
  • GeoServer extends this by providing Dynamic Symbolizer, which allow computing symbol names on a per-feature basis by embedding CQL expressions ${<cql expression>} in both Mark and External Graphic.

More: >> Graphic Symbology <<

<PointSymbolizer>
  <Graphic>
    <Mark>
      <WellKnownName>circle</WellKnownName>
      <Fill>
        <CssParameter name="fill">#ff8000</CssParameter>
      </Fill>
      <Stroke>
        <CssParameter name="stroke">#000000</CssParameter>
        <CssParameter name="stroke-width">1</CssParameter>
      </Stroke>
    </Mark>
    <Size>4</Size>
  </Graphic>
</PointSymbolizer>
<PointSymbolizer>
  <Graphic>
    <ExternalGraphic>
      <OnlineResource xlink:type="simple" xlink:href="http://localhost:8080/POI_Icon/train.png" />
      <Format>image/png</Format>
    </ExternalGraphic>
    <Size>18.3</Size>
  </Graphic>
</PointSymbolizer>

Mark

External Graphics

Dynamic Symbolizer

<PointSymbolizer>
  <Graphic>
    <ExternalGraphic>
      <OnlineResource xlink:type="simple" xlink:href="http://localhost:8080/Icon/capital_${state_name='Kuala Lumpur'}.png" />
      <Format>image/png</Format>
    </ExternalGraphic>
    <Size>11</Size>
  </Graphic>
</PointSymbolizer>

Eg: Show icon for KL state label only

3. Specifying Symbolizer Sizes in Ground Units

  • The SLD 1.0 specification allows giving symbolizer sizes in a single unit of measure.
  • This means that the size of symbolizers is the same at all zoom levels (which is usually the desired behaviour).
<LineSymbolizer uom="http://www.opengeospatial.org/se/units/metre">
  <Stroke>
    <CssParameter name="stroke">#0000FF</CssParameter>
    <CssParameter name="stroke-width">5</CssParameter>
  </Stroke>
</LineSymbolizer>

Zoom 1

Zoom 2

Zoom 3

Eg: Applying the style to the Street dataset shows how the line widths increase as the map is zoomed in:

More: >> Specific Symbolizer Sizes <<

4. Z-Ordering

  • Z-Ordering vendor option control the order in which the features are being loaded and painted on the map.
  • It replicating the same above/below (Street/Rail Line) relationships found in the reality.
  • In other words, this is the function which enables the Street Elevation feature in LBD map.
<!-- 4261 4261 4261 4261 4261 4261 4261 4261 4261 4261 -->



<!-- NORMAL STREET Outline 4261 -->
<se:FeatureTypeStyle>
  <se:Rule>

    <se:Name>NORMAL STREET Outline 4261</se:Name>
    <MaxScaleDenominator>5000</MaxScaleDenominator>
    <MinScaleDenominator>3000</MinScaleDenominator>
    <se:Description><se:Title>Street Bttm Low</se:Title></se:Description>

    <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:Or><ogc:PropertyIsEqualTo><ogc:PropertyName>street_cl</ogc:PropertyName><ogc:Literal>3</ogc:Literal></ogc:PropertyIsEqualTo><ogc:Or><ogc:PropertyIsEqualTo><ogc:PropertyName>street_cl</ogc:PropertyName><ogc:Literal>4</ogc:Literal></ogc:PropertyIsEqualTo><ogc:Or><ogc:PropertyIsEqualTo><ogc:PropertyName>street_cl</ogc:PropertyName><ogc:Literal>6</ogc:Literal></ogc:PropertyIsEqualTo><ogc:Or><ogc:PropertyIsEqualTo><ogc:PropertyName>street_cl</ogc:PropertyName><ogc:Literal>0</ogc:Literal></ogc:PropertyIsEqualTo><ogc:Or><ogc:PropertyIsEqualTo><ogc:PropertyName>street_cl</ogc:PropertyName><ogc:Literal>5</ogc:Literal></ogc:PropertyIsEqualTo><ogc:Or><ogc:PropertyIsEqualTo><ogc:PropertyName>street_cl</ogc:PropertyName><ogc:Literal>-9999</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Or></ogc:Or></ogc:Or></ogc:Or></ogc:Or></ogc:Or></ogc:Filter>

    <se:LineSymbolizer><se:Stroke><se:SvgParameter name="stroke">#c1c1c1</se:SvgParameter><se:SvgParameter name="stroke-width">11</se:SvgParameter><se:SvgParameter name="stroke-linejoin">mitre</se:SvgParameter><se:SvgParameter name="stroke-linecap">round</se:SvgParameter></se:Stroke></se:LineSymbolizer>

  </se:Rule><se:VendorOption name="sortBy">street_ele</se:VendorOption>
  <se:VendorOption name="sortByGroup">roads</se:VendorOption>
</se:FeatureTypeStyle>

<!-- MAJOR STREET Outline 4261 -->
<se:FeatureTypeStyle>
  <se:Rule>
    <se:Name>MAJOR STREET Outline 4261</se:Name>
    <MaxScaleDenominator>5000</MaxScaleDenominator>
    <MinScaleDenominator>2500</MinScaleDenominator>
    <se:Description><se:Title>Major Bttm Low</se:Title></se:Description>

    <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:PropertyIsEqualTo><ogc:PropertyName>street_cl</ogc:PropertyName><ogc:Literal>2</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter>

    <se:LineSymbolizer><se:Stroke><se:SvgParameter name="stroke">#a09f61</se:SvgParameter><se:SvgParameter name="stroke-width">12</se:SvgParameter><se:SvgParameter name="stroke-linejoin">mitre</se:SvgParameter><se:SvgParameter name="stroke-linecap">round</se:SvgParameter></se:Stroke></se:LineSymbolizer>

  </se:Rule><se:VendorOption name="sortBy">street_ele</se:VendorOption>
  <se:VendorOption name="sortByGroup">roads</se:VendorOption>
</se:FeatureTypeStyle>

<!-- HIGHWAY Outline 4261 -->
<se:FeatureTypeStyle>
  <se:Rule>
    <se:Name>HIGHWAY Outline 4261</se:Name>
    <MaxScaleDenominator>5000</MaxScaleDenominator>
    <MinScaleDenominator>2500</MinScaleDenominator>
    <se:Description><se:Title>Hway Bottom</se:Title></se:Description>

    <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:PropertyIsEqualTo><ogc:PropertyName>street_cl</ogc:PropertyName><ogc:Literal>1</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter>

    <se:LineSymbolizer><se:Stroke><se:SvgParameter name="stroke">#b2924e</se:SvgParameter><se:SvgParameter name="stroke-width">13</se:SvgParameter><se:SvgParameter name="stroke-linejoin">mitre</se:SvgParameter><se:SvgParameter name="stroke-linecap">round</se:SvgParameter></se:Stroke></se:LineSymbolizer>

  </se:Rule><se:VendorOption name="sortBy">street_ele</se:VendorOption>
  <se:VendorOption name="sortByGroup">roads</se:VendorOption>
</se:FeatureTypeStyle>

<!-- NORMAL STREET Fill 4261 -->
<se:FeatureTypeStyle>
  <se:Rule>

    <se:Name>NORMAL STREET Fill 4261</se:Name>
    <MaxScaleDenominator>5000</MaxScaleDenominator>
    <MinScaleDenominator>3000</MinScaleDenominator>
    <se:Description><se:Title>Street Bttm Low</se:Title></se:Description>

    <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:Or><ogc:PropertyIsEqualTo><ogc:PropertyName>street_cl</ogc:PropertyName><ogc:Literal>3</ogc:Literal></ogc:PropertyIsEqualTo><ogc:Or><ogc:PropertyIsEqualTo><ogc:PropertyName>street_cl</ogc:PropertyName><ogc:Literal>4</ogc:Literal></ogc:PropertyIsEqualTo><ogc:Or><ogc:PropertyIsEqualTo><ogc:PropertyName>street_cl</ogc:PropertyName><ogc:Literal>6</ogc:Literal></ogc:PropertyIsEqualTo><ogc:Or><ogc:PropertyIsEqualTo><ogc:PropertyName>street_cl</ogc:PropertyName><ogc:Literal>0</ogc:Literal></ogc:PropertyIsEqualTo><ogc:Or><ogc:PropertyIsEqualTo><ogc:PropertyName>street_cl</ogc:PropertyName><ogc:Literal>5</ogc:Literal></ogc:PropertyIsEqualTo><ogc:Or><ogc:PropertyIsEqualTo><ogc:PropertyName>street_cl</ogc:PropertyName><ogc:Literal>-9999</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Or></ogc:Or></ogc:Or></ogc:Or></ogc:Or></ogc:Or></ogc:Filter>

    <se:LineSymbolizer><se:Stroke><se:SvgParameter name="stroke">#ffffff</se:SvgParameter><se:SvgParameter name="stroke-width">9</se:SvgParameter><se:SvgParameter name="stroke-linejoin">mitre</se:SvgParameter><se:SvgParameter name="stroke-linecap">round</se:SvgParameter></se:Stroke></se:LineSymbolizer>

  </se:Rule><se:VendorOption name="sortBy">street_ele</se:VendorOption>
  <se:VendorOption name="sortByGroup">roads</se:VendorOption>
</se:FeatureTypeStyle>

<!-- MAJOR STREET Fill 4261 -->
<se:FeatureTypeStyle>
  <se:Rule>
    <se:Name>MAJOR STREET Fill 4261</se:Name>
    <MaxScaleDenominator>5000</MaxScaleDenominator>
    <MinScaleDenominator>2500</MinScaleDenominator>
    <se:Description><se:Title>Major Bttm Low</se:Title></se:Description>

    <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:PropertyIsEqualTo><ogc:PropertyName>street_cl</ogc:PropertyName><ogc:Literal>2</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter>

    <se:LineSymbolizer><se:Stroke><se:SvgParameter name="stroke">#fffdaf</se:SvgParameter><se:SvgParameter name="stroke-width">10</se:SvgParameter><se:SvgParameter name="stroke-linejoin">mitre</se:SvgParameter><se:SvgParameter name="stroke-linecap">round</se:SvgParameter></se:Stroke></se:LineSymbolizer>

  </se:Rule><se:VendorOption name="sortBy">street_ele</se:VendorOption>
  <se:VendorOption name="sortByGroup">roads</se:VendorOption>
</se:FeatureTypeStyle>

<!-- HIGHWAY Fill 4261 -->
<se:FeatureTypeStyle>
  <se:Rule>
    <se:Name>HIGHWAY Fill 4261</se:Name>
    <MaxScaleDenominator>5000</MaxScaleDenominator>
    <MinScaleDenominator>2500</MinScaleDenominator>
    <se:Description><se:Title>Hway Bttm</se:Title></se:Description>

    <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:PropertyIsEqualTo><ogc:PropertyName>street_cl</ogc:PropertyName><ogc:Literal>1</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter>

    <se:LineSymbolizer><se:Stroke><se:SvgParameter name="stroke">#ffe68c</se:SvgParameter><se:SvgParameter name="stroke-width">11</se:SvgParameter><se:SvgParameter name="stroke-linejoin">mitre</se:SvgParameter><se:SvgParameter name="stroke-linecap">round</se:SvgParameter></se:Stroke></se:LineSymbolizer>

  </se:Rule><se:VendorOption name="sortBy">street_ele</se:VendorOption>
  <se:VendorOption name="sortByGroup">roads</se:VendorOption>
</se:FeatureTypeStyle>

More: >> Z-Ordering <<

LBD Map

How it was made?

  1. Data Preparation
  2. Create Workspace, Store, Layer
  3. Styling Layer
  4. Create Layer Group
  5. Output - WMS, WMTS, WFS

The Easy Steps:

1. Data Preparation

2. Workspace - Store - Layer

3 Workspaces

3 Stores

105 Layers

3. Styling Layers

56 Styles

44 Layers

4. Layer Groups

Layer Group 1 : Section_Label

Layer Group 2 : All_Features_Label

Layer Group 3 : TM_Smartmap

What is inside Malaysia:TM_Smartmap layer that we always use?

5. Output WMS - WMTS - WFS

{Workspace Name}:{Layer/Layer Group Name}

Layer Name Format

Malaysia:TM_Smartmap

Malaysia_WFS_POI:POI

Example:

Thank You

Geoserver

By Annuar Faiz

Geoserver

  • 1,657