Ticket #999 (closed enhancement: fixed)
added ability to write Raster Attribute Tables to hfa format
|Reported by:||robert.denham@…||Owned by:||warmerdam|
Description (last modified by rdenham) (diff)
Modified hfadataset.cpp so that it is possible to write a RAT to an HFA image. The function WriteNamedRAT does the work, and is based on ReadNamedRAT. You can now use: GDALSetDefaultRAT(band,rat); to save a rat to an HFA images. Frank there are a couple of things that we weren't sure about in the behaviour of this. For example, if you create 2 RAT's, and call GDALSetDefaultRAT(band,rat1); GDALSetDefaultRAT(band,rat2); then in the image the rats are concatenated, rather than rat2 overwriting rat1. We weren't sure whether this is what would be expected, but it seemed more difficult to remove a RAT so we left it. GDALRATInitializeFromColorTable also produced some results that might be unexpected. If you use GDALRATInitializeFromColorTable to set up the rat, then save it to an image with a colour table, when looking at the RAT from Imagine you will see duplicate columns for each colour. It seems that Imagine automatically concatenates the colour table to the RAT. One final thing, is there any chance of python bindings for the RAT stuff? Robert
Note: See TracTickets for help on using tickets.