[gdal-dev] Access to MetaData in driver implementation

Frank Warmerdam warmerdam at pobox.com
Fri Mar 13 11:58:11 EDT 2009


lidiriel wrote:
> Hello,
> 
> I work on th create method for ISIS2 file (PDS driver). I can write
> raster file but i have a problem with meta data.
> In the case where the user would be use "poDriver->CreateCopy" i try
> to copy and write metaData in the new file. But now i get metadata
> with the method "char** metaData = GetMetadata();"
> But the list of string is not easy to handling.
> Is there another solution for access to the metadata for creating a new
> (or updated copy) of header ?
> Construct and access to an XML tree (like TrySaveXML) ? or another
> method ?

Lidiriel,

You can also request individual items from the source dataset
using GetMetadataItem().  The functions CSLFetchNameValue(), and
CPLParseNameValue() from gdal/port/cpl_string.h should also make
it fairly easily to search for particular keys in a string list and
to decompose an entry into it's name and value portions.

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