I'm struggling to set the a background colour to transparent in an SLD file for a 4-channel GEOTIFF using GeoServer 2.1.4.
I think I've set my background colour to transparent alpha layer in a graphics package correctly.
I've set up an SLD file to read Red/Green/Blue channels of my GEOTIFF = this resolves colours correctly for the RGB image = but still shows the background black colour (see below).
When I do a GetFeatureInfo request on the WMS, I can see an ALPHA_BAND=0 where I want the transparency and ALPHA_BAND =255 where I do not want transparency (see attached figure).
I was hopeing to do something like setting the ALPHA_BAND=0 to Opacity=0 in the SLD or something. However, there's no option in SLD schema that I can see ?
I've read the SLD cookbook and the SLD reference documentation. Alpha transparency is referred to but only with ColorMap' property. Can I mix and match 'ColorMap' and ChannelSelection' properties in the SLD ?
Am I going about this the right way ? Thanks in advance for assistance!
This is the SLD I'm using:
<?xml version="1.0" encoding="ISO-8859-1"?> <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>bathy example</Name> <UserStyle> <Name>RGB image 3 channels</Name> <Title>RGB image</Title> <FeatureTypeStyle> <Rule> <RasterSymbolizer> <ChannelSelection> <RedChannel> <SourceChannelName>1</SourceChannelName> </RedChannel> <GreenChannel> <SourceChannelName>2</SourceChannelName> </GreenChannel> <BlueChannel> <SourceChannelName>3</SourceChannelName> </BlueChannel> </ChannelSelection> </RasterSymbolizer> </Rule> </FeatureTypeStyle> </UserStyle> </NamedLayer> </StyledLayerDescriptor>