1

I'm trying to style a raster layer using SLD. This layer is displayed on a mapbox map.

I have encountered two problems:

  1. It's supposed to create a gradient interpolated across all specified colours, but there is no gradient... Colours are changing at the specified cap without grading.

  2. I want the first colormap entry to be transparent but it seems that the opacity attribute isn't working

Here's the layer I'm trying to style:

https://geo.weather.gc.ca/geomet?service=WMS&version=1.3.0&request=GetCapabilities&layer=RADAR_1KM_RSNO

Here's what it looks like:

see screenshot

Here's the code of my sld file:

<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor version="1.0.0"
  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"
  xsi:schemaLocation="http://www.opengis.net/sld
  http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">
<NamedLayer>
<Name>RDPA.24F_PR</Name>
<UserStyle>
<Name>SLD_RDPA.24F_PR</Name>
<FeatureTypeStyle>
<Rule>
<RasterSymbolizer>
<ColorMap>
        <ColorMapEntry color="#000000" quantity="0.5" opacity="0"/>
        <ColorMapEntry color="#C2D8FF" quantity="1"/>
        <ColorMapEntry color="#ADD0FF" quantity="2"/>
        <ColorMapEntry color="#91BAFF" quantity="3"/>
        <ColorMapEntry color="#5B96FF" quantity="4"/>
        <ColorMapEntry color="#2AA8E2" quantity="5"/>
        <ColorMapEntry color="#38E1CE" quantity="6"/>
        <ColorMapEntry color="#4AFFB9" quantity="7"/>
        <ColorMapEntry color="#84FF76" quantity="8"/>
        <ColorMapEntry color="#FFFF00" quantity="9"/>
        <ColorMapEntry color="#FFD500" quantity="10"/>
        <ColorMapEntry color="#FD4400" quantity="11"/>
        <ColorMapEntry color="#EE1300" quantity="12"/>
        <ColorMapEntry color="#C11100" quantity="13"/>
        <ColorMapEntry color="#7D0E00" quantity="14"/>
        <ColorMapEntry color="#000000" quantity="200"/>
  </ColorMap>
</RasterSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
Louis Chaussé
  • 167
  • 4
  • 11

0 Answers0