[Gdal-dev] Extracting HDF metadata

Ivan Lucena ILucena at clarku.edu
Mon Jul 17 11:50:06 EDT 2006


Hi there,

I have my last fight with HDF recently, so I would like to suggest one
or two things:

Based in some source of documentation from NASA, I guess that Inessa is
probably sure of what "product" is this HDF and that the
"PRODUCT_UL_CORNER_LAT" must be present.
 
So, my suggestion is to use HDFExplorer (there is free version available
at www.space-research.org) and open the "CoreMetadata.0" that have the
Metadata in a complete text mode.

The other suggestion is to try to read this file in some GIS that reads
LandSat7 Hierarchical Data Format (file extensions .L1*), because this
format has "PRODUCT_UL_CORNER_LAT". I goggle for "HDF
PRODUCT_UL_CORNER_LAT" and it gives me more LandSat7-HDF then HDF-EOS
file format references.

The best luck,

Ivan


-----Original Message-----
From: gdal-dev-bounces at lists.maptools.org
[mailto:gdal-dev-bounces at lists.maptools.org] On Behalf Of Andrey Kiselev
Sent: 17 July 2006 10:10
To: gdal-dev at lists.maptools.org
Subject: Re: [Gdal-dev] Extracting HDF metadata

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
_______________________________________________
Gdal-dev mailing list
Gdal-dev at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/gdal-dev




More information about the Gdal-dev mailing list