We are using geoserver 2.15.0. We created a small geotif (see test.tif) containing the values 0-9, and we created the following sld:
<?xml version=“1.0” encoding=“UTF-8”?>
<StyledLayerDescriptor xmlns=“http://www.opengis.net/sld” version=“1.0.0” xmlns:sld=“http://www.opengis.net/sld” xmlns:gml=“http://www.opengis.net/gml” xmlns:ogc=“http://www.opengis.net/ogc”>
<UserLayer>
<sld:LayerFeatureConstraints>
<sld:FeatureTypeConstraint/>
</sld:LayerFeatureConstraints>
<sld:UserStyle>
<sld:Name>test10</sld:Name>
<sld:FeatureTypeStyle>
<sld:Rule>
<sld:RasterSymbolizer>
<sld:ChannelSelection>
<sld:GrayChannel>
<sld:SourceChannelName>1</sld:SourceChannelName>
</sld:GrayChannel>
</sld:ChannelSelection>
<sld:ColorMap type=“values”>
<sld:ColorMapEntry label=“0” color=“#d7191c” quantity=“0”/>
<sld:ColorMapEntry label=“1” color=“#e85b3a” quantity=“1”/>
<sld:ColorMapEntry label=“2” color=“#f99e59” quantity=“2”/>
<sld:ColorMapEntry label=“3” color=“#fec980” quantity=“3”/>
<sld:ColorMapEntry label=“4” color=“#ffedaa” quantity=“4”/>
<sld:ColorMapEntry label=“5” color=“#edf8b9” quantity=“5”/>
<sld:ColorMapEntry label=“6” color=“#c7e9ad” quantity=“6”/>
<sld:ColorMapEntry label=“7” color=“#9dd3a7” quantity=“7”/>
<sld:ColorMapEntry label=“8” color=“#64abb0” quantity=“8”/>
<sld:ColorMapEntry label=“9” color=“#2b83ba” quantity=“9”/>
</sld:ColorMap>
</sld:RasterSymbolizer>
</sld:Rule>
</sld:FeatureTypeStyle>
</sld:UserStyle>
</UserLayer>
</StyledLayerDescriptor>
When the type of the ColorMap is set to ‘ramp’ or ‘interval’, the resulting maps are as expected (see ramp.jpg and intervals.jpg). When we change the type to ‘values’, the resulting map looks strange (see values.jpg).
|