[Gdal-dev] r.out.gdal: SetColorInterpretation() not supported
neteler at itc.it
Tue Jan 16 12:22:57 EST 2007
On Tue, Jan 16, 2007 at 11:42:47AM -0500, Frank Warmerdam wrote:
> Markus Neteler wrote:
> >for some weeks we have a nice C implementation of r.out.gdal
> >in GRASS, but a color table problem remains:
> >GRASS 6.3.cvs (spearfish60): > r.out.gdal fields out=fields.tif
> >ERROR 6: SetColorInterpretation() not supported for this dataset.
> > 100%
> >GRASS 6.3.cvs (spearfish60): > r.info -t fields
> >GRASS 6.3.cvs (spearfish60): > r.info -r fields
> >The (probably) relevant line in the main.c file is:
> > /* Set color interpretation. TODO: Implement this better ... */
> > GDALSetRasterColorInterpretation(hBand, ((band + 3) % 4 +
> > GCI_RedBand));
> >Maybe it fails on an 8 bit range?
> >Suggestion are welcome as colorized export is an important thing,
> The GeoTIFF driver provides very little post-creation control over band
> color interpretations. The actual implementation only supports marking
> band 2 or 4 of a greyscale or rgb file as alpha. All other efforts are
> essentially passed on to the generic implementation which produces the
> error you see.
> That doesn't necessarily mean the color interpretation is set wrong, though
> it could.
> I would add that most other drivers also have no meaningful implementation
> of this method.
> My suggestion is to call:
> CPLPushErrorHandler( CPLQuietErrorHandler );
> just before calling GDALSetRasterColorInterpretation() and then:
> just afterwards. This will at least supress the confusing message.
in fact the message is right since the result does not contain
color (which is essentially my problem). I also tried the HFA
driver to no avail.
In summary: the resulting file becomes grey scale.
PS: Using today's SVN
More information about the Gdal-dev