ubarsc / rios

A raster processing layer on top of GDAL
https://www.rioshome.org
GNU General Public License v3.0
15 stars 8 forks source link

allow fallback to ColorTable API if requested #32

Closed gillins closed 3 years ago

gillins commented 3 years ago

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.