[Gdal-dev] Extracting HDF metadata

Inessa Shalomov ishalomo at yahoo.com
Mon Jul 17 16:18:47 EDT 2006


Hello,
   
  Thanks for the info. I am not sure whether this specific file that I have contains this key  -- I'll need to get more info about this product. I was given a few HDF file formats and asked to retrieve specific fields, but I am not sure whether the products correspond to the spec I am using.
   
  I did try to use gdalinfo on the file, as well as on it's subdatasets. A lot of data was outputted, but nothing close to the field I am interested in. So, given that fact, can I conclude that the field is not available in that file? Does gdalinfo and getMetadata return all the possible metadata in that product? 
   
  Thanks,
  Inessa

Andrey Kiselev <dron at ak4719.spb.edu> wrote:
  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


 		
---------------------------------
Groups are talking. We’re listening. Check out the handy changes to Yahoo! Groups. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20060717/207b88ee/attachment.html


More information about the Gdal-dev mailing list