[Gdal-dev] Extracting HDF metadata

Frank Warmerdam warmerdam at pobox.com
Mon Jul 17 10:46:28 EDT 2006


Inessa Shalomov wrote:
> Has anyone tried to extract specific metadata fields from an HDF file 
> format with GDAL?
>  
> I am trying to use GDAL and its HDF file format support to extract 
> specific metadata fields from an HDF file. The GetMetadataItem() call is 
> not recognizing the metadata keys I am passing in, although according to 
> the spec I am using, the keys are valid.
>  
> I used the following code to
> GDALDataset *poDataset;
> GDALAllRegister();
> poDataset = (GDALDataset *) GDALOpen (pszFilename, GA_ReadOnly);
> const char* retval = poDataset->GetMetadataItem(“PRODUCT_UL_CORNER_LAT”, 
> NULL);
>  
> Am I not making the right API calls for HDF? Are there any additional 
> method calls to retrieving the metadata?
>  
> Any help would be greatly appreciated.

Inessa,

The HDF driver will return various kinds of metadata depending on the
product and other factors.  But the best way to explore what is available
is to use gdalinfo.  The metadata support is not necessarily comprehensive.

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




More information about the Gdal-dev mailing list