Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WCS 2.0.1 single band RangeSubset writes out 3-band GeoTIFF #5415

jratike80 opened this issue Mar 28, 2017 · 3 comments

WCS 2.0.1 single band RangeSubset writes out 3-band GeoTIFF #5415

jratike80 opened this issue Mar 28, 2017 · 3 comments


Copy link

With Mapserver 7.0.0 and with an attached mapfile, the following GetCoverage request that selects only one band with RangeSubset yields a 3-band GeoTIFF which only appears greyscale because the requested BandA is copied to all three bands.


Part of gdalinfo report from the "out.tif" file
Band 1 Block=2000x1 Type=Byte, ColorInterp=Red
Band 2 Block=2000x1 Type=Byte, ColorInterp=Green
Band 3 Block=2000x1 Type=Byte, ColorInterp=Blue


Copy link

jratike80 commented May 3, 2017

More information:
This happens with the default GeoTIFF driver. The default driver has also another unwanted feature: it writes a RGB output from multi-band source like RGB-NIR 4-band imagery. It feels like the default IMAGEMODE is RGB even it is documented to be FLOAT32, and that the "wcs_imagemode" metadata item does not have any effect on the default image/tiff outputformat.

Single band / dual band / 4-band output is successful with a self-configured outputformat that sets the imagemode into BYTE.

  MIMETYPE "image/tiff"

For RBG-NIR imagery it seems also good to add this formatoption that prevents labeling the fourth band as alpha:


I wonder if it will be enough to improve the documentation or if the default GeoTIFF outputformat for WCS should be changed in the code. An out-of-the-box support for more than 3 bands would be convenient.

Copy link

@jratike80 Is it necessary to add the PROCESSING "BANDS=1,2,3,4" directive for it to output the 4 bands?

Schpidi added a commit to constantinius/mapserver that referenced this issue Mar 22, 2018
Copy link

Schpidi commented Mar 22, 2018

I added tests for this in #5566 hoping this was fixed recently as I can't reproduce. Please re-open if still valid.

@Schpidi Schpidi closed this as completed Mar 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

3 participants