<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><br>Sorry if this question has been asked before; I've searched but can't find a full explaination.<br><br>I am trying to access geolocation information in MODIS L1B data files. I was hoping that the Latitude and Longitude data sets would be visible via gdalinfo however when I run this those 2 datasets appear to be skipped over.<br><br>Here's a gdalinfo output from an example modis data file;<br><br>$ gdalinfo MOD03.Terra20061216T021152Z20061216T021611Z.hdf <br>Driver: HDF4/Hierarchical Data Format Release 4<br>Size is 512, 512<br>Coordinate System is `'<br>Metadata:<br>--cut--<br> ASSOCIATEDSENSORSHORTNAME=MODIS<br> ASSOCIATEDPLATFORMSHORTNAME=Terra<br> ASSOCIATEDINSTRUMENTSHORTNAME=MODIS<br>--cut--<br>
PROCESSVERSION=5.0.2<br>--cut--<br>Subdatasets:<br> SUBDATASET_1_NAME=HDF4_EOS:EOS_SWATH:"MOD03.Terra20061216T021152Z20061216T021611Z.hdf":MODIS_Swath_Type_GEO:Height<br> SUBDATASET_1_DESC=[1620x1354] Height (16-bit integer)<br> SUBDATASET_2_NAME=HDF4_EOS:EOS_SWATH:"MOD03.Terra20061216T021152Z20061216T021611Z.hdf":MODIS_Swath_Type_GEO:SensorZenith<br> SUBDATASET_2_DESC=[1620x1354] SensorZenith (16-bit integer)<br> SUBDATASET_3_NAME=HDF4_EOS:EOS_SWATH:"MOD03.Terra20061216T021152Z20061216T021611Z.hdf":MODIS_Swath_Type_GEO:SensorAzimuth<br> SUBDATASET_3_DESC=[1620x1354] SensorAzimuth (16-bit integer)<br> SUBDATASET_4_NAME=HDF4_EOS:EOS_SWATH:"MOD03.Terra20061216T021152Z20061216T021611Z.hdf":MODIS_Swath_Type_GEO:Range<br> SUBDATASET_4_DESC=[1620x1354] Range (16-bit unsigned integer)<br> SUBDATASET_5_NAME=HDF4_EOS:EOS_SWATH:"MOD03.Terra20061216T021152Z20061216T021611Z.hdf":MODIS_Swath_Type_GEO:SolarZenith<br>
SUBDATASET_5_DESC=[1620x1354] SolarZenith (16-bit integer)<br> SUBDATASET_6_NAME=HDF4_EOS:EOS_SWATH:"MOD03.Terra20061216T021152Z20061216T021611Z.hdf":MODIS_Swath_Type_GEO:SolarAzimuth<br> SUBDATASET_6_DESC=[1620x1354] SolarAzimuth (16-bit integer)<br> SUBDATASET_7_NAME=HDF4_EOS:EOS_SWATH:"MOD03.Terra20061216T021152Z20061216T021611Z.hdf":MODIS_Swath_Type_GEO:Land/SeaMask<br> SUBDATASET_7_DESC=[1620x1354] Land/SeaMask (8-bit unsigned integer)<br> SUBDATASET_8_NAME=HDF4_EOS:EOS_SWATH:"MOD03.Terra20061216T021152Z20061216T021611Z.hdf":MODIS_Swath_Type_GEO:gflags<br> SUBDATASET_8_DESC=[1620x1354] gflags (8-bit unsigned integer)<br><br>I'm certain that the Latitude and Longitude data is there, because I can see it with hdp;<br><br>$ hdp dumpsds -h MOD03.Terra20061216T021152Z20061216T021611Z.hdf<br>--cut--<br>Variable Name = Latitude<br> Index = 0<br>
Type= 32-bit floating point<br> Ref. = 20<br> Rank = 2<br> Number of attributes = 3<br> Dim0: Name=nscans*10:MODIS_Swath_Type_GEO<br> Size = 1620<br> Scale Type = number-type not set<br> Number of attributes = 0<br> Dim1: Name=mframes:MODIS_Swath_Type_GEO<br> Size =
1354<br> Scale Type = number-type not set<br> Number of attributes = 0<br> Attr0: Name = units<br> Type = 8-bit signed char <br> Count= 7<br> Value = degrees<br><br>Is there a way to access the Latitude and Longitude data with gdal or do I have to drop down to using the HDF4 library directly?<br><br>The frmt_hdf4.html file shipped with gdal includes an example as such;<br><pre>$ gdalinfo GSUB1.A2001124.0855.003.200219309451.hdf<br>Driver:
HDF4/Hierarchical Data Format Release 4<br>Size is 512, 512<br>Coordinate System is `'<br>Metadata:<br> HDFEOSVersion=HDFEOS_V2.7<br> Number of Scans=204<br> Number of Day mode scans=204<br> Number of Night mode scans=0<br> Incomplete Scans=0<br></pre>
...a lot of metadata output skipped...<p>
</p><pre>Subdatasets:<br> SUBDATASET_1_NAME=HDF4_SDS:MODIS_L1B:GSUB1.A2001124.0855.003.200219309451.hdf:0<br> SUBDATASET_1_DESC=[408x271] Latitude (32-bit floating-point)<br> SUBDATASET_2_NAME=HDF4_SDS:MODIS_L1B:GSUB1.A2001124.0855.003.200219309451.hdf:1<br> SUBDATASET_2_DESC=[408x271] Longitude (32-bit floating-point)<br> SUBDATASET_3_NAME=HDF4_SDS:MODIS_L1B:GSUB1.A2001124.0855.003.200219309451.hdf:2<br> SUBDATASET_3_DESC=[12x2040x1354] EV_1KM_RefSB (16-bit unsigned integer)</pre><br>Even if it's not possible to get at the lat/lon data with gdal, I'm interested in understanding why it doesn't work.<br><br>Cheers & thanks<br><br>Huw Lynch<br><br></div></div></body></html>