I have a raster displaying slopes whose pixel values go from 0 to 85. Like most values are between the range (0 - 30) when publishing in GeoServer I want to apply to it the following sld file to make the raster more readable.

<?xml version="1.0" encoding="UTF-8"?>
<sld:StyledLayerDescriptor version="1.0.0" xmlns="http://www.opengis.net/sld" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:sld="http://www.opengis.net/sld">
                            <sld:ColorMapEntry color="#000000" opacity="1.0" quantity="0"/>
                            <sld:ColorMapEntry color="#FFFFFF" opacity="1.0" quantity="35"/>
                            <sld:ColorMapEntry color="#000000" opacity="0.0" quantity="255"/>

The problem is that when applying this style to that specific raster a rgb(255, 128, 128) reddish colour appears not only in the layer bounding box but in the all visible area. See image below.

layer when applying the sld file

Here is the image with the default raster style of GeoServer with the value of the pixels.

Raster Default geoServer's Raster Style

When applying the style to rasters with no data values the reddish colour does not appears.

I also have tried deleting the last sld:ColorMapEntry in case is not working properly but the reddish colour keeps appearing.

Your Answer

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

Browse other questions tagged or ask your own question.