[gdal-dev] Alpha band masking

Even Rouault even.rouault at spatialys.com
Mon Nov 16 01:21:16 PST 2015


Le samedi 14 novembre 2015 22:26:48, Mutlu Ozdogan a écrit :
> Dear Evan
> Thank you so much for the input. I actually tried exactly those steps and
> unfortunately I still get 0s in the output file. Thank you again

Could you post the result of "gdalinfo -mm your_input_file.tif" and the exact 
GDAL commands you use ?

> Mutlu
> 
> Sent from my iPhone
> 
> > On Nov 14, 2015, at 1:00 PM, Even Rouault <even.rouault at spatialys.com>
> > wrote:
> > 
> > Le samedi 14 novembre 2015 19:49:02, ozdogan at wisc.edu a écrit :
> >> Dear All
> >> I have a 4-band air photo image in which the 4th band is the NIR band
> >> but it has also been designated as an alpha band. It is the geotiff
> >> format. For some reason whenever I reproject this file (using gdalwarp)
> >> or resize it (using gdal_translate) all four bands of the resulting
> >> files have zero values. It is as if the alpha band is being used to
> >> mask all band values. Any help reprojecting or windowing this large
> >> file without making while retaining all 4 band values would be much
> >> appreciated. Thank you
> > 
> > Mutlu,
> > 
> > The issue is probably indeed the NIR band being recognized as an alpha
> > band. You can remove the alpha interpretation with :
> > 
> > gdal_translate in.tif tmp.tif -co alpha=no
> > rm tmp.tif.aux.xml (or del tmp.tif.aux.xml on Windows)
> > 
> > The removal of tmp.tif.aux.xml is important otherwise the alpha
> > interpretation would be kept in this XML file
> > 
> > And then you can gdalwarp this tmp.file with the arguments you need :
> > 
> > gdalwarp tmp.tif ...
> > 
> > Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list