[mapserver-users] Fwd: [UMN_MAPSERVER-USERS] fill opacity in SLD

Bruce Raup brauplists at gmail.com
Tue Jan 7 15:25:04 PST 2014


Hello all,

I have set up an SLD for a raster WMS as a test.  I want our WMS user to be
able to supply their own SLD, with the aim of presenting a raster with
categorical values in various colors according to pixel value, with some of
them, which represent flag values, transparent.  Based on my experiments,
and this 6-year-old thread, it appears that MapServer can't do this?

I'd like the SLD to read something like this:

<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor version="1.0.0"
  xmlns="http://www.opengis.net/sld"
  xmlns:se="http://www.opengis.net/se"
  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>
    <se:Name>freezethaw_amsre</se:Name>
      <UserStyle>
        <se:Name>xxx</se:Name>
        <se:FeatureTypeStyle>
          <se:Rule>
            <se:RasterSymbolizer>
              <se:ColorMap type="values">
                  <ColorMapEntry color="#0000ff" quantity="0" opacity="1" />
                  <ColorMapEntry color="#ff0000" quantity="1" opacity="1" />
                  <ColorMapEntry color="#a5a500" quantity="2" opacity="1" />
                  <ColorMapEntry color="#00ff00" quantity="3" opacity="1" />
                  <ColorMapEntry color="#ffffff" quantity="251" opacity="0"
/>
                  <ColorMapEntry color="#111111" quantity="252" opacity="0"
/>
                  <ColorMapEntry color="#775533" quantity="254" opacity="0"
/>
                  <ColorMapEntry color="#7799bb" quantity="255" opacity="0"
/>
              </se:ColorMap>
            </se:RasterSymbolizer>

          </se:Rule>
        </se:FeatureTypeStyle>
      </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

I only seem to be able to change the opacity of the entire image -- not of
specific regions within the image according to pixel value.  Is there a way
to achieve this using MapServer?

Thanks in advance,
Bruce


On Mon, Nov 12, 2007 at 7:15 AM, Yewondwossen Assefa <yassefa at dmsolutions.ca
> wrote:

> Jacolin Yves wrote:
>
>> Hi,
>>
>> I am trying to set up a fill-opacity via an SLD url for a polygonal
>> layer. I thought succeed to realize this last week but I failed to do it
>> after changing some code in my application. I read this bug (4 years old):
>> http://trac.osgeo.org/mapserver/ticket/1155 and think it is impossible
>> to do it.
>>
>> My question: is it possible to change the opacity of a layer using an SLD
>> url?
>>
>>  SLD 1.0 does not support the opacity parameter at a layer level except
> for the raster symbolizer. SLD supports opacity setting at "CLASS" level
> but MapServer does not have the capacity for now to specify opacity per
> class/style.
>
>
>  I am afraid to had dream last week :(
>>
>> Y.
>>
>
>
> --
> ----------------------------------------------------------------
> Assefa Yewondwossen
> Software Analyst
>
> Email: assefa at dmsolutions.ca
> http://www.dmsolutions.ca/
>
> Phone: (613) 565-5056 (ext 14)
> Fax:   (613) 565-0925
> ----------------------------------------------------------------
>



-- 
Bruce Raup
http://cires.colorado.edu/~braup/

-- 
Bruce Raup
http://cires.colorado.edu/~braup/

-- 
Bruce Raup
http://cires.colorado.edu/~braup/ <http://cires.colorado.edu/~braup/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20140107/17b7c22a/attachment.htm>


More information about the MapServer-users mailing list