Palette
This example XML file displays a reanalysis of sea surface temperature as a named red-blue palette and the analysis error as bands of blackening specified using thresholds.
<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.1.0" xsi:schemaLocation="http://www.opengis.net/sld/StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:se="http://www.opengis.net/se" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:resc="http://www.resc.reading.ac.uk">
<NamedLayer>
<se:Name>OSTIA/analysed_sst</se:Name>
<UserStyle>
<se:Name>Red-blue palette showing SST</se:Name>
<se:CoverageStyle>
<se:Rule>
<se:RasterSymbolizer>
<se:Opacity>1.0</se:Opacity>
<se:ColorMap>
<resc:Segment fallbackValue="#FF006400">
<se:LookupValue>Rasterdata</se:LookupValue>
<resc:BelowMinValue>extend</resc:BelowMinValue>
<resc:ValueList>
<se:Name>div-BuRd2</se:Name>
</resc:ValueList>
<resc:AboveMaxValue>extend</resc:AboveMaxValue>
<resc:Range>
<resc:Minimum>270.0</resc:Minimum>
<resc:Maximum>310.0</resc:Maximum>
<resc:Spacing>linear</resc:Spacing>
</resc:Range>
<resc:NumberOfSegments>250</resc:NumberOfSegments>
</resc:Segment>
</se:ColorMap>
</se:RasterSymbolizer>
</se:Rule>
</se:CoverageStyle>
</UserStyle>
</NamedLayer>
<NamedLayer>
<se:Name>OSTIA/analysis_error</se:Name>
<UserStyle>
<se:Name>Show uncertainty with thresholded blackening</se:Name>
<se:CoverageStyle>
<se:Rule>
<se:RasterSymbolizer>
<se:Opacity>1.0</se:Opacity>
<se:ColorMap>
<se:Categorize fallbackValue="#00000000">
<se:LookupValue>Rasterdata</se:LookupValue>
<se:Value>#00000000</se:Value>
<se:Threshold>0.5</se:Threshold>
<se:Value>#33000000</se:Value>
<se:Threshold>1.0</se:Threshold>
<se:Value>#66000000</se:Value>
<se:Threshold>1.5</se:Threshold>
<se:Value>#99000000</se:Value>
<se:Threshold>2.0</se:Threshold>
<se:Value>#CC000000</se:Value>
<se:Threshold>2.5</se:Threshold>
<se:Value>#FF000000</se:Value>
</se:Categorize>
</se:ColorMap>
</se:RasterSymbolizer>
</se:Rule>
</se:CoverageStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
The resulting output image and its legend are shown below: