I want to use an external SLD (hosted in my server) for symbolizing a raster in GeoServer.
The SLD below works if used as default style in GeoServer. If I copy it (changing some colors) and put outside GeoServer, save as SLD (or XML), and call the GetMap with SLD=https://my_server/mySLD.sld the map I get is still with the 'default, Geoserver' style
<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
xmlns="http://www.opengis.net/sld"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:se="http://www.opengis.net/se">
<NamedLayer>
<Name>my_schema:my_layer</Name>
<UserStyle>
<FeatureTypeStyle>
<Rule>
<RasterSymbolizer>
<Geometry>
<PropertyName>GRAY_INDEX</PropertyName>
</Geometry>
<Opacity>1</Opacity>
<ColorMap>
<ColorMapEntry color="#E69800" label="1" opacity="0.0" quantity="0.0"/>
<ColorMapEntry color="#1b4bde" label="Building" opacity="1.0" quantity="1.0"/>
<ColorMapEntry color="#bcbcbc" label="Ground cover" opacity="1.0" quantity="2.0"/>
</ColorMap>
</RasterSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
shortly, WMS call would be like this (also tried withou STYLES param)
https://my_geoserver_url/wms?service=WMS&version=1.1.0&request=GetMap&layers=my_schema:my_layer&STYLES=&SLD=https://my_server/my_sld.sld&transparent=true&bbox=...&format=image/png
I did this for dynamic filtering in vector data and all good (SLDs are created dynamically via PHP), so I am wondering if the problem is that with RASTER data is not possible