[Gdal-dev] Copying meta data

Frank Warmerdam warmerdam at pobox.com
Fri Nov 17 18:54:44 EST 2006

Matt Hanson wrote:
> Ok, good to know.  I'm currently using ENVI as an output file now, but one
> of my colleagues had written a driver for our own format I haven't tested
> yet.  Hopefully it supports writing metadata.
> So if I set GDAL_PAM_ENABLED then when I call SetMetaData, SetGeoTransform,
> or SetProjectionRef, then it will automatically just output it to an aux.xml
> file?   If I have GDAL_PAM_ENABLED set to no then will it generate an error?


Well, whether an error will actually be generated or not, I'm not so sure.
Generally SetMetadata() never fails because the default implementation is
to dump the metadata into the base class datastructure for metadata, but the
metadata will not get written to disk.

I would also note that the GDAL_PAM_ENABLED flag only affects drivers that
have been updated to support the PAM mechanism.  This includes most core
drivers but if you have written your own format driver, and it does not
derive the classes from GDALPamDataset and GDALPamRasterBand then the PAM
mechanism will likely *not* work for your driver.

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    | President OSGeo, http://osgeo.org

More information about the Gdal-dev mailing list