0

I am trying to get transparent parts of an 3-channel raster with NoData pixel values in GeoServer.

As suggested in here, I created alpha channel with pixels that have No Data Value (0) as a mask using GDAL `gdalwarp -srcnodata 0 -dstalpha input.tif output.tif` As a result I got 4-channel (RGB+alpha) where the pixels that previously were 0 now have 0 values in all four channels and those, that were > 0, in alpha channel have value 255. Also No Data Value is set to 0.

When I upload raster to GeoServer (v2.5.2) using QGIS plugin OpenGeo Explorer, instead of transparent pixels I get black pixels. What could be the problem? I have also tried without setting No Data Value without results.

---------------EDIT----------------
Geoserver version: 2.5.2
Raster style:

   <?xml version="1.0" encoding="UTF-8"?>
   <sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:sld="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" version="1.0.0">
     <sld:NamedLayer>
<sld:Name>RGB raster</sld:Name>
<sld:UserStyle>
  <sld:Name>RGB raster</sld:Name>
  <sld:FeatureTypeStyle>
    <sld:Name>name</sld:Name>
    <sld:Rule>
      <sld:Name>Single symbol</sld:Name>
      <sld:RasterSymbolizer>
        <sld:ChannelSelection>
          <sld:RedChannel>
            <sld:SourceChannelName>1</sld:SourceChannelName>
          </sld:RedChannel>
          <sld:GreenChannel>
            <sld:SourceChannelName>2</sld:SourceChannelName>
          </sld:GreenChannel>
          <sld:BlueChannel>
            <sld:SourceChannelName>3</sld:SourceChannelName>
          </sld:BlueChannel>
        </sld:ChannelSelection>
      </sld:RasterSymbolizer>
    </sld:Rule>
  </sld:FeatureTypeStyle>
</sld:UserStyle>

Here is the request: request=GetMap&layers=jaun:ORO2&styles=&bbox=515813.19564,305943.471,516026.19564,306105.471&width=512&height=389&srs=EPSG:3059&format=application/openlayers&transparent=true

  • 2
    Can you share the following information: 1. version of geoserver 2. style you are using to show the data 3. GetMap format you are asking from GeoExplorer Simone. – simogeo Oct 14 '14 at 12:53
  • Updated qoestion text with requested information! – M_K Oct 15 '14 at 11:28
  • Basically all i need is for GeoExplorer to show trasparency where image alpha band pixel value is 0. – M_K Oct 15 '14 at 13:59
1

Ciao, the style you are using is stripping out the alpha band. Use the standard/default raster.sld style.

Simone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.