<p dir="ltr">Luis,</p>
<p dir="ltr">I suspect the problem is how raster values are scaled. I think the raster SLD is applied essentially as a set of classes on the layer but it is not clear how scaling gets set. What does the layer definition look like? Can you try doing what you want with mapserver classes in the map file?</p>
<p dir="ltr">While your SLD looks fine, how these are used by mapserver is fiddly.</p>
<p dir="ltr">Best regards,<br>
Frank<br>
</p>
<div class="gmail_quote">On Feb 15, 2013 2:55 AM, "Luís de Sousa" <<a href="mailto:luis.a.de.sousa@gmail.com">luis.a.de.sousa@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello everyone,<br>
<br>
I have a raster layer with the following range of values:<br>
<br>
$ gdalinfo -hist my_data.tiff<br>
[...]<br>
STATISTICS_MAXIMUM=128.30499267578<br>
STATISTICS_MEAN=6.3870258293789<br>
STATISTICS_MINIMUM=-9.5671482086182<br>
STATISTICS_STDDEV=11.960967394892<br>
<br>
This is layer is being published through Mapserver and I get perfectly<br>
correct maps through WMS.<br>
<br>
Now I'd like to style the maps retrieved by mapserver using the SLD<br>
parameter of the GetMap request. I'm starting with the basic example in the<br>
SLD Cookbook [1]:<br>
<br>
<?xml version="1.0" encoding="UTF-8"?><br>
<StyledLayerDescriptor version="1.0.0"<br>
xmlns="<a href="http://www.opengis.net/sld" target="_blank">http://www.opengis.net/sld</a>"<br>
xmlns:ogc="<a href="http://www.opengis.net/ogc" target="_blank">http://www.opengis.net/ogc</a>"<br>
xmlns:xlink="<a href="http://www.w3.org/1999/xlink" target="_blank">http://www.w3.org/1999/xlink</a>"<br>
xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>"<br>
xsi:schemaLocation="<a href="http://www.opengis.net/sld" target="_blank">http://www.opengis.net/sld</a><br>
<a href="http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd" target="_blank">http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd</a>"><br>
<NamedLayer><br>
<Name>my_data</Name><br>
<UserStyle><br>
<Title>SLD Cook Book: Two color gradient</Title><br>
<FeatureTypeStyle><br>
<Rule><br>
<RasterSymbolizer><br>
<ColorMap><br>
<ColorMapEntry color="#008000" quantity="-10" /><br>
<ColorMapEntry color="#663333" quantity="130" /><br>
</ColorMap><br>
</RasterSymbolizer><br>
</Rule><br>
</FeatureTypeStyle><br>
</UserStyle><br>
</NamedLayer><br>
</StyledLayerDescriptor><br>
<br>
When I issue a request with this SLD file:<br>
<br>
<a href="http://my.server/cgi-bin/mapserv?map=/var/www/file.map&VERSION=1.1.1&REQUEST=GetMap&LAYERS=my_data&SRS=EPSG:3857&BBOX=497600,6784100,498900,6786500&WIDTH=300&HEIGHT=600&FORMAT=image/gif&SLD=http://my.server/SLD/my_data.sld" target="_blank">http://my.server/cgi-bin/mapserv?map=/var/www/file.map&VERSION=1.1.1&REQUEST=GetMap&LAYERS=my_data&SRS=EPSG:3857&BBOX=497600,6784100,498900,6786500&WIDTH=300&HEIGHT=600&FORMAT=image/gif&SLD=http://my.server/SLD/my_data.sld</a><br>
<br>
I'm getting back simply a green patch (see the file my_data_SLD.gif).<br>
Whereas without the SLD argument the features in the file are quite visible<br>
(my_data.gif).<br>
<br>
<<a href="http://osgeo-org.1560.n6.nabble.com/file/n5034507/my_data_SLD.gif" target="_blank">http://osgeo-org.1560.n6.nabble.com/file/n5034507/my_data_SLD.gif</a>><br>
<br>
<<a href="http://osgeo-org.1560.n6.nabble.com/file/n5034507/my_data.gif" target="_blank">http://osgeo-org.1560.n6.nabble.com/file/n5034507/my_data.gif</a>><br>
<br>
So what's wrong in here? The SLD file is exactly the same found in the SLD<br>
cookbock, I doubt it has an error. Do I have to configure the layer somehow<br>
in the map file in order for Mapserver to style it with the SLD?<br>
<br>
Thank you.<br>
<br>
[1]<br>
<a href="http://docs.geoserver.org/latest/en/user/styling/sld-cookbook/rasters.html#example-raster" target="_blank">http://docs.geoserver.org/latest/en/user/styling/sld-cookbook/rasters.html#example-raster</a><br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.n6.nabble.com/SLD-with-colour-ramp-in-WMS-GetMap-tp5034507.html" target="_blank">http://osgeo-org.1560.n6.nabble.com/SLD-with-colour-ramp-in-WMS-GetMap-tp5034507.html</a><br>
Sent from the Mapserver - User mailing list archive at Nabble.com.<br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
</blockquote></div>