[gdal-dev] GDAL doesn't read GeoTiff .msk mask file

Nikolai Bezdna mofoyoda at gmail.com
Mon Dec 19 17:34:55 PST 2016

Even, thanks a lot for replying.

No, the strange thing is neither gdalinfo, nor gdal_translate work on my .msk file.
Gdalinfo returns "not recognized as a supported file format”. Though this .msk works ok in ArcGIS.
I can even export raster from ArcGIS with baked-in mask (like setting output to 16-bit and nodata value to 256 (anything bigger than 255)).
But then I don’t know how to get gdal translate it back to 8 bit with adding a mask band from pixels with value of 256. Is that possible?


> On lundi 19 décembre 2016 13:38:04 CET Even Rouault wrote:
>> Nikolai,
>>> I’ve got an 8-bit 3-band (RGB) GeoTiff file created in ArcGIS and it has a
>>> mask file (myfile.tif.msk) along with it, indicating which pixels have
>>> "nodata" value. When viewing it in ArcMap, I get “nodata” for masked
>>> pixels. But when viewing in QGIS, I get an unmasked raster and masked
>>> pixels return pixel values of R G and B bands. Gdalinfo doesn’t return a
>>> .tif.msk file in a list of dataset files (however it does return
>>> .aux.xml)
> Actually looking at the code and experimenting, that's super weird. The .msk file 
> should always be listed in the file list, even if there are no INTERNAL_MASK_FLAGS_x 
> metadata item. Does gdalinfo on the .msk file succeed ?
> -- 
> Spatialys - Geospatial professional services
> http://www.spatialys.com
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20161219/6b1c110f/attachment.html>

More information about the gdal-dev mailing list