So it turns out that GTiff (and possibly other formats) don't actually support the RasterAttributeTable API properly. GDAL "fakes" support by saving data into a .tif.aux.xml file. If you want to save a color table that other software can see you need to use the old slow ColorTable API to save the colors into the .tif file itself.
It's worth noting that for KEA and HFA at least the RasterAttributeTable and ColorTable APIs are equivalent - they save data into the same place.
This PR adds support for dropping back to the ColorTable API when writing so if you need to supply a GTiff to someone not using GDAL they can see the colours... I could possibly add support for reading but this is probably already covered by the rios.rat module.
So it turns out that GTiff (and possibly other formats) don't actually support the
RasterAttributeTable
API properly. GDAL "fakes" support by saving data into a.tif.aux.xml
file. If you want to save a color table that other software can see you need to use the old slowColorTable
API to save the colors into the .tif file itself.It's worth noting that for KEA and HFA at least the
RasterAttributeTable
andColorTable
APIs are equivalent - they save data into the same place.This PR adds support for dropping back to the
ColorTable
API when writing so if you need to supply aGTiff
to someone not using GDAL they can see the colours... I could possibly add support for reading but this is probably already covered by therios.rat
module.