[gdal-dev] ``HDF4Image: Can't get the list of geolocation maps in swath mod07''

Andrey Kiselev dron at ak4719.spb.edu
Tue Dec 11 11:58:40 EST 2007


On Tue, Dec 11, 2007 at 06:14:53PM +0700, Ivan Shmakov wrote:
> http://theory.asu.ru/~ivan/modis/MOD07_L2.hdf
> 
>  > I think the real problem is somwhere else.
> 
>         Indeed, it is.
> 
>         I've tried to trace the problem and have stumbled upon the
>         following.
> 
> $ nl -ba gdal/frmts/hdf4/hdf4imagedataset.cpp
> ...
>   1608  /* --------------------------------------------------------------------
> */
>   1609  /*      xx
>          */
>   1610  /* --------------------------------------------------------------------
> */
>   1611      nDataFields = SWnentries( hSW, HDFE_NENTGFLD, &nStrBufSize );
> 
>         This call correctly returns `2'...
> 
> ...
>   1615      if ( nDataFields !=
>   1616           SWinqgeofields(hSW, pszGeoList, paiRank, paiNumType) )
> 
>         ... and this one fills `pszGeoList' with `Latitude,Longitude'.
> 
>   1617      {
> ...
>   1621      }
> ...
>   1643      // Read geolocation data
>   1644      nDimMaps = SWnentries( hSW, HDFE_NENTMAP, &nStrBufSize );
> 
>         However, there `0' is returned...

Yes, and that is correct, because your HDF file does not contain
dimension maps, i.e. it is slightly broken dataset.

I should admit that I can't fix this thing without either serious
reworking the HDF-EOS library logic or hardcoding the workaround into
the driver (thing that I hate to do, because there are too many variants
of HDF-EOS products and our driver already full of such things).

I have filled the bug report on this topic:

 http://trac.osgeo.org/gdal/ticket/2079

Feel free to add yourself to CC: list to be informed on progress. I am
afraid that I will not be fixed in 1.5 branch.

Best regards,
Andrey


-- 
Andrey V. Kiselev
ICQ# 26871517


More information about the gdal-dev mailing list