Missing / wrong Legend of WMS service

by Lukas   Last Updated August 14, 2019 08:22 AM - source

i am working with geoserver to publish some wms services. One of them is a temperature overview. With the help of my styling file (SLD) i am coloring up each tile of the map depending on its value. This works fine, but the legend does not show up as expected. I can't find the issue in my SLD file.

<?xml version="1.0" encoding="ISO-8859-1"?>
<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" xmlns:gml="http://www.opengis.net/gml" 
 xsi:schemaLocation="http://www.opengis.net/sld">
  <NamedLayer>
    <Name>temp_overview</Name>
    <UserStyle>
      <Title>Temperature Overview</Title>
      <FeatureTypeStyle>
        <Rule>
          <Title>temperature overview</Title>
          <RasterSymbolizer>
            <Opacity>1.0</Opacity>
            <ColorMap>
              <ColorMapEntry color="#2F32EA" quantity="0.0" label="0&#176;C" />
              <ColorMapEntry color="#956C80" quantity="7.5" />
              <ColorMapEntry color="#FAA615" quantity="15.0" label="15&#176;C" />
              <ColorMapEntry color="#FA540C" quantity="22.5" />   
              <ColorMapEntry color="#FA0202" quantity="30.0" label="30&#176;C" />
            </ColorMap>
          </RasterSymbolizer>
        </Rule>
        <Rule>
            <PolygonSymbolizer>
               <Fill>
                 <CssParameter name="fill">
                   <ogc:Function name="Interpolate">
                     <ogc:PropertyName>dTa</ogc:PropertyName>
                     <ogc:Literal>0</ogc:Literal>
                     <ogc:Literal>#2F32EA</ogc:Literal>

                     <ogc:Literal>7.5</ogc:Literal>
                     <ogc:Literal>#956C80</ogc:Literal>

                     <ogc:Literal>15</ogc:Literal>
                     <ogc:Literal>#FAA615</ogc:Literal>

                     <ogc:Literal>22.5</ogc:Literal>
                     <ogc:Literal>#FA540C</ogc:Literal>

                     <ogc:Literal>30</ogc:Literal>
                     <ogc:Literal>#FA0202</ogc:Literal>

                     <ogc:Literal>color</ogc:Literal>
                   </ogc:Function>
                 </CssParameter>
               </Fill>
            </PolygonSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
   </NamedLayer>
</StyledLayerDescriptor>

The corresponding getLegendGraphic call shows up the following graphic:

enter image description here

Tags : geoserver wms sld


Related Questions



Validate StyledLayerDescriptor (SLD)

Updated June 04, 2015 10:09 AM

Creating new GeoServer user through rest api?

Updated September 28, 2017 10:22 AM

Geoserver layer pyramids in googledrive

Updated May 07, 2018 16:22 PM

Add time dimension to vector layer in geoserver REST

Updated September 11, 2017 13:22 PM