[gdal-dev] Color Columns in Raster Attribute Tables

Sam Gillingham gillingham.sam at gmail.com
Sun Jan 12 16:06:01 PST 2014


Hi List,

There appears to be an inconsistency in the way color columns are handled
within Raster Attribute Tables (RATs) by different drivers. Color columns
are currently identified by their 'usage' setting - GFU_Red, GFU_Green,
GFU_Blue and GFU_Alpha. The HFA driver presents color columns as doubles
between 0 and 1 as this is how they are stored in the file. The IDRISI
driver presents them as integers between 0 and 255 like the Color Table
API. Code that uses color columns from the RAT API currently needs to know
which driver it is using, defeating one of the aims of GDAL.

I propose that the RAT API be defined so that color columns always appear
as Integer 0-255 no matter what type and range they are stored as. This
would make the RAT API consistent with the Color Table API and would mean a
change to the HFA driver

Another option is that flags are added to the RAT SetValue, GetValueAs* and
ValuesIO calls to specify the conversion to/from the native type. This
seems a bigger change.

Any thoughts?

Sam.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140113/4d2d8fa3/attachment.html>


More information about the gdal-dev mailing list