[Gdal-dev] accessing Class_Names from an img file in GDAL

Frank Warmerdam fwarmerdam at gmail.com
Mon Feb 28 09:37:48 EST 2005


On Mon, 28 Feb 2005 09:26:51 -0500, Stephane Routelous <route at cae.com> wrote:
> Hi,
> 
> I would like to have access to the Class_Names values from an img file (hfa)
> I compiled the hfatest programm from frmts\hfa directory, and dumping the
> tree gives me :

Stephane, 

I am planning ot incorporate a mechanism for returning
"raster attribute tables" such as the Imagine DescriptorTable
stuff as part of GDAL 1.3.0 which I would hope to have available
within 4-6 weeks.

> Can I have this information in GDAL  ?
> Can I access this information at the HFAHandle level ?
> As the dump of the tree does not output the strings, it seems those class
> names are not read.
> How can I read them ?

In fact, the HFA API proper does not directly support the
reading of descriptor table columns now.  You can use it
to fetch the offsets to the column data, but then you need to 
read it yourself. An example of this is in the method
HFABand::GetPCT() in gdal/frmts/hfa/hfaband.cpp. 
 

If you can wait, I would suggest holding out for the
raster attribute table implementation.  If you can't wait, 
you can hack it in a manner similar to the GetPCT() method.

Good luck,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the Gdal-dev mailing list