#999 closed enhancement (fixed)
added ability to write Raster Attribute Tables to hfa format
Reported by: | Owned by: | warmerdam | |
---|---|---|---|
Priority: | normal | Milestone: | 1.9.0 |
Component: | GDAL_Raster | Version: | unspecified |
Severity: | minor | Keywords: | HFA |
Cc: | Markus Neteler |
Description (last modified by )
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
Attachments (3)
Change History (8)
by , 18 years ago
Attachment: | hfadataset.cpp.patch added |
---|
by , 13 years ago
Attachment: | hfadataset.cpp.1.7.3.patch added |
---|
Patch to add ability to create raster attribute tables for HFA format. Updated for 1.7.3
comment:1 by , 13 years ago
Description: | modified (diff) |
---|
comment:2 by , 13 years ago
This patch has been used operationally for approx. 5 years by the Queensland Dept. of Environment and Resource Management (Australia) without any problems. We are pretty keen to get this accepted into the mainline and would appreciate any suggestions to help us do so.
We note that the IDRISI driver also supports writing of RATs and the Python bindings for this functionality also exist.
The issues mentioned in the original report we think are reasonable limitations given the HFA implementation of RAT's and Imagine's treatment of them.
Any thoughts on what needs to be done to this patch to have it accepted?
comment:3 by , 13 years ago
Keywords: | HFA added |
---|---|
Milestone: | → 1.9.0 |
Priority: | high → normal |
Status: | new → assigned |
Sam,
I'm a reviewing and will apply it in trunk unless I run into serious problems.
comment:4 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I have applied the patch in trunk (r21657). I note that WriteNamedRAT() does not support writing the unique valued binning function which comes up in the small test case.
Thanks and sorry for the lengthy delay in applying this patch. I'm very chicken about changes to the hfa driver.
patch for hfdataset.cpp to allow writing of RAT's