[gdal-dev] HDF5 metadata format problems

Frank Warmerdam warmerdam at pobox.com
Tue Jun 14 10:51:38 EDT 2011


On 11-06-14 10:38 AM, Alex Mantaut wrote:
> Frank:
>          Thanks for your reply. I thought that there could be a trim funcion on
> CPL... I will use that code to trim my string...

Alex,

In fact, with a quick check I see I have added a Trim() method to the
CPLString to remove trailing white space.

> Another question: To get several fields from the file's metadata, is it better
> to use GetMetadata() and then search within the array for the fields, or use
> GetMetadataItem() several times in order to get the necesary fields?
> GetMedata() can take more memory than necesary, but I'm not sure if
> GetMetadataItem() performs a read on the file, which could be slow...

GetMetadataItem() is normally implemented to fetch from an internal metadata
list which is populated at the point of open.  So if you know what you are
looking for feel free to just do the GetMetadataItem().

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