[gdal-dev] Translating files with a external mask file

Frank Warmerdam warmerdam at pobox.com
Thu Oct 27 12:48:07 EDT 2011


On Thu, Oct 27, 2011 at 8:14 AM, Travis Kirstine
<traviskirstine at gmail.com> wrote:
> I have a rgb geotiff with a external mask file
> rgb_withmaskfile.tif.msk, I would like to convert the files to a
> compressed GeoTiff using a command simalar to the one below.  This
> command will generate a illegal band # error
>
> gdal_translate rgb_withmaskfile.tif results.tif -b 1 -b 2 -b 3 -mask 4
> -co COMPRESS=JPEG -co PHOTOMETRIC=YCBCR --config
> GDAL_TIFF_INTERNAL_MASK YES

Travis,

Is the mask really band 4?  I presume the mask (from the .msk file)
is not treated as a regular band of the source file and cannot be
referenced as such.  I would hope that gdal_translate would
automatically try to translate the associated mask though I must
confess I haven't tried this myself.  If it does not then please file a
ticket.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Software Developer


More information about the gdal-dev mailing list