Friday, 3 April 2015

geoserver - Setting transparency in an SLD file for a 4 channel GEOTIFF


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).


enter image description here


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:


    
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">

bathy example

RGB image 3 channels

RGB image





1


2



3











No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...