[GRASS-dev] r.out.gdal[.sh] sets null by force
tutey at o2.pl
Sat May 12 22:45:59 CEST 2007
I think there is a bug in r.out.gdal that it sets NoData wrong (GForge
is down, thus reporting directly to list). See:
$ r.mapcalc 'check=rand(0,256)'
$ r.info -rt check
$ r.out.gdal check out=check.tif type=Byte
$ r.in.gdal in=check.tif out=check_re
$ r.info -rt check_re
Rasters "check" and "check_re" have different max values. That's
because r.out.gdal sets 255 to null in "check.tif" by force:
$ gdalinfo -mm check.tif | grep 'NoData\|Min'
As there is no null in original "check" raster, that should rather read:
and no "NoData".
Note that r.out.gdal.sh does:
$ r.out.gdal.sh check out=check2.tif type=Byte
$ gdalinfo -mm check2.tif | grep 'NoData\|Min'
which is kind of strange too, as value 256 is not present in input
"check" at all, and 256 is beyond GDAL's "Byte" value range. But at
least it doesn't corrupt raster's max value.
More information about the grass-dev