[Gdal-dev] Extracting HDF metadata

Andrey Kiselev dron at ak4719.spb.edu
Mon Jul 17 10:10:16 EDT 2006


On Fri, Jul 14, 2006 at 08:21:32PM -0700, Inessa Shalomov wrote:
>   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?

Inessa,

That should work in case there is "PRODUCT_UL_CORNER_LAT" record in the
metadata of your HDF file. Are you sure that your file actually contains
this record? Have you tried gdalinfo on that file? Are you opening
proper subdataset instead of the main HDF file (look here for details on
HDF subdatasets: http://www.remotesensing.org/gdal/frmt_hdf4.html)?

Regards,
Andrey


-- 
Andrey V. Kiselev
ICQ# 26871517



More information about the Gdal-dev mailing list