I am trying to style a raster in GeoServer using a SLD file. I have 850 individual values, but only 179 color mappings (i.e., unique RGBA codes). I want to keep all 850 values, as they are meaningful, but the SLD file fails to style with more than 255 color mappings (even if < 255 distinct colors are used).
Is there a way in which I can maintain all 850 values and still style the raster with the SLD?
The work around I can see would be to create a "styling raster" that reclasses each of the 850 values to a color-mapping indicator, but this is less than desirable due to the loss of meaningful information and the redundant raster layer.
Example code to give you a better idea of what I'm talking about:
<ColorMap> ... <sld:ColorMapEntry color="#eeb241" quantity="255" label="255th value"/> <sld:ColorMapEntry color="#eeb241" quantity="256" label="256th value"/> ... </ColorMap>
The styling from the SLD fails here. Note that the colors are the same in the above two lines (e.g., unique color number 179), but the quantities have exceeded 255.
The quantity to color mappings unfortunately are not organized logically, and thus I am unsure that an
intervals type SLD will do the trick. The
ColorMapEntrys look more like:
<ColorMap type="intervals"> <ColorMapEntry color="#ffffff" quantity="3001" label="1st value"/> <ColorMapEntry color="#ffffff" quantity="3002" label="2nd value"/> <ColorMapEntry color="#0000ff" quantity="3003" label="3rd value"/> ... other values ... <ColorMapEntry color="#ffffff" quantity="3089" label="89th value"/> ... </ColorMap>
So, there you can see that white is being mapped to many values, but the quantities are not organized in a logical fashion that groups the color mapping together.