[Gdal-dev] wrong nodata returned in GDAL dependent software
Frank Warmerdam
warmerdam at pobox.com
Fri Jun 15 16:03:59 EDT 2007
Maciej Sieczka wrote:
> Hi,
>
> Although my GeoTIFF has a value range 0-255 with nodata set to 256 [1],
> both QGIS 0.8.1 and OpenEV output '255' when I query the area supposed
> to be nodata. Any ideas what could be the culprit? I *suspect* the
> issue might be in GDAL itself, as I can reproduce the problem in two
> different viewers. Example GeoTiff attached. My specs:
Maciej,
Your gdalinfo report listed the file as data type Byte. The largest value
that can be represented in a Byte is 255. So there is no way to read back
values of 256 from such a file.
If the file was written with GDAL from a buffer bigger than Byte but
to a file with data type Byte, then GDAL would clamp a value of 256 to
the maximum representable value, 255, while writing. Perhaps this happened?
In any event, it is not meaningful to have a nodata value of 256 for a byte
data file.
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 | President OSGeo, http://osgeo.org
More information about the Gdal-dev
mailing list