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" 
      <Title>Temperature Overview</Title>
          <Title>temperature overview</Title>
              <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" />
                 <CssParameter name="fill">
                   <ogc:Function name="Interpolate">






The corresponding getLegendGraphic call shows up the following graphic:

enter image description here

  • is your data a raster or a polygon? it doesn't entirely make sense to apply both Symbolizers
    – Ian Turton
    Aug 14 '19 at 7:14
  • Both geom types are available. It is a raster but i also got the polygons
    – Lukas
    Aug 14 '19 at 7:27
  • but not in the same layer? make 2 SLDs
    – Ian Turton
    Aug 14 '19 at 7:34
  • 1
    GeoServer does not have a datasource that can serve a mix of rasters and polygons. E.g., if you have a geopackage, you'll have to create two separate stores, one to serve the raster part, one to serve the vector part. If you have a NetCDF instead, only rasters can be read from there. Aug 14 '19 at 7:46
  • my fault - i got polygons in my dataset now. Is it possible to get a interpolated legend (like a colormap of type ramp) out of this dataset?
    – Lukas
    Aug 14 '19 at 9:17

"One disadvantage of using these functions for styling is that they are not displayed in WMS legend graphics." (https://docs.geoserver.org/stable/en/user/styling/sld/tipstricks/transformation-func.html)

ok, it is not possible to build a WMS legend graphic for this transformation.

  • That's indeed correct. Aug 16 '19 at 8:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.