I have an uncompressed GeoTIFF file (figure 1) with the following band information:
Image Structure Metadata: INTERLEAVE=PIXEL Band 1 Block=5000x1 Type=Byte, ColorInterp=Red Band 2 Block=5000x1 Type=Byte, ColorInterp=Green Band 3 Block=5000x1 Type=Byte, ColorInterp=Blue Band 4 Block=5000x1 Type=Byte, ColorInterp=Undefined
I have compressed the file using the following set of parameters:
gdal_translate -of gtiff -co compress=jpeg -co jpeg_quality=85 -co tiled=yes -co photometric=rgb uncompressed.tif compressed.tif
This gives me a file with the following information:
Image Structure Metadata: COMPRESSION=JPEG INTERLEAVE=PIXEL Band 1 Block=256x256 Type=Byte, ColorInterp=Red Band 2 Block=256x256 Type=Byte, ColorInterp=Green Band 3 Block=256x256 Type=Byte, ColorInterp=Blue Band 4 Block=256x256 Type=Byte, ColorInterp=Undefined
When I serve my compressed image through GeoServer 2.1.4 I get image in figure 2 instead of the image in figure 1, which is what I would like. My goal is to have GeoServer just display the first three bands as RGB and ignore the 4th band.
I have tried to style the raster layer in GeoServer using SLD by adding the following channel configuration, but it didn't help.
<ChannelSelection> <RedChannel> <SourceChannelName>1</SourceChannelName> </RedChannel> <GreenChannel> <SourceChannelName>2</SourceChannelName> </GreenChannel> <BlueChannel> <SourceChannelName>3</SourceChannelName> </BlueChannel> </ChannelSelection>
Why is my image server through GeoServer 2.1.4 looking the way it is and how do I configure GeoServer to display the image 'correctly'?