[Gdal-dev] help !

Frank Warmerdam warmerdam at pobox.com
Thu Mar 6 23:21:24 EST 2003

Anand Madhavan wrote:
> Hi,
>    I basically need to get ALL the information about a .img (hfa) file
> header and copy it into another .img (hfa) file I create with my own new
> data. Can anyone help me as to what API's I should use and where to look for
> them ? Any help is highly appreciated. Thank you.
> Regards,
> Anand


I don't think anyone has used GDAL or the HFA libraries to try and
clone all the metadata associated with an existing .img file in a new one
that has different imagery.  It isn't possible with the GDAL API as any
information outside the GDAL data model would be discarded.  It could likely
be accomplished with the lower level HFA API; however, not without substantial

If you really want to preserve *all* the header information and just place
new imagery, why not just literally copy the file, and then update the imagery
in the new file?  If you want to do things like change the file size then you
obviously aren't preserving all the existing header information exactly and
you should provide a more detailed specification of your requirements.

If you just want to preserve a bunch of common metadata from an existing .img
file (but not all possible metadata) then it might be possible to extend the
GDAL driver to carry this stuff as metadata.  I'm not sure if that would be
a good approach though.

Best regards,

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