[Gdal-dev] hdf4 patch for modis 9 product to pick up geometry info...

David Burken dburken at comcast.net
Mon Jun 20 15:04:19 EDT 2005


Hi Frank,

Your hdf mail made me think of this.

The following diff allows me to pick up the geometry info from an hdf4 
modis 9 product.  I'm not sure if this is the best way to do it but it 
seems to work. 

I'm also have problems finding another tool that can verify the 
correctness of the geometry.  ENVI does not pick it up, at least mine 
trial version anyway.  In ossim it seems to be off in the latitude 
direction by about nine minutes when swiped against an elevation cell.  
It's a "sinusoidal " projection.

Let me know if you want the whole file.

Here is the diff for file (basically two lines):  
gdal/frmts/hdf4/hdf4dataset.cpp
817a825,833
 >     else if ( CSLFetchNameValue(poDS->papszGlobalMetadata, 
"HDFEOSVersion") ||>               ( (pszValue = 
CSLFetchNameValue(poDS->papszGlobalMetadata,
 >                                                "PARAMETERNAME"))
 >                 && EQUALN( pszValue, "MOD09A1", 7 ) ) )
 >      {
 >         poDS->iSubdatasetType = EOS_GRID;
 >         poDS->pszSubdatasetType = "EOS_GRID";
 >      }
 >
834c850
<     if ( CSLFetchNameValue(poDS->papszGlobalMetadata, "HDFEOSVersion") )
---
 >     if ( poDS->iSubdatasetType == EOS_GRID )

Take care,
Dave

ps: Curious how your big tiff is doing???




More information about the Gdal-dev mailing list