Color columns in RAT not being read as integers with HFA
|Reported by:||Sam Gillingham||Owned by:||warmerdam|
As discussed recently on gdal-dev, the HFA driver reads color columns from the raster attribute table as the type and range they appear in the file which is float 0..1 when written by Imagine.
This is at odds with the IDRISI driver, the Color Table API and comments in the definition of GDALRATFieldUsage in gdal.h. Attached patches (against GDAL trunk) always makes these columns appear as int 0..255 to GDAL but retains reading and writing them to HFA as float 0..1. It also makes it impossible to create color columns as any type other that int. I have taken the opportunity to fix the problem where the alpha column had been called 'Alpha' but in fact Imagine uses the name 'Opacity'.
There was a comment on gdal-dev that this solution could remove precision from the color columns if the number in the HFA file was not precisely N/255. However this is also an issue with the color table API and would take some much larger changes to address and I think is not a major problem for most users.