[GRASS-dev] new r.out.gdal fails to preserve 8bit color

Glynn Clements glynn at gclements.plus.com
Mon Jan 22 17:18:09 EST 2007


Markus Neteler wrote:

> Questions:
> - do we need SetColorInterpretation? alias GDALSetRasterColorInterpretation()

Most drivers don't implement that method; AFAICT, the only ones which
do are ECW, Mem, NITF, Raw and VRT. The others all seem to determine
the colour interpretation from the format's metadata. E.g. the TIFF
driver uses the TIFFTAG_PHOTOMETRIC tag; this tag is set to
PHOTOMETRIC_PALETTE by SetColorTable().

> - why does the second example below tell me
>   ERROR 6: SetNoDataValue() not supported for this dataset.
> 
> But maybe that are questions for the GDAL list.
> 
> Examples, that now work with colors:
> 
> # categorial map export:
> r.out.gdal roads out=roads.tif type=UInt16
> qgis roads.tif
> 
> # numerical map export:
> r.out.gdal elevation.dem out=elev.img format=HFA
> qgis elev.img

Because the HFA driver doesn't implement the SetNoDataValue() method;
presumably the format has nowhere to store this information. The only
formats which do implement it are AAIGrid, TIFF, HDF4, Mem, Raw and
VRT (i.e. AAIGrid, TIFF, and HDF4 plus the "generic" drivers).

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list