<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>&nbsp; ASSOCIATEDSENSORSHORTNAME=MODIS<br>&nbsp; ASSOCIATEDPLATFORMSHORTNAME=Terra<br>&nbsp; ASSOCIATEDINSTRUMENTSHORTNAME=MODIS<br>--cut--<br>&nbsp;
 PROCESSVERSION=5.0.2<br>--cut--<br>Subdatasets:<br>&nbsp; SUBDATASET_1_NAME=HDF4_EOS:EOS_SWATH:"MOD03.Terra20061216T021152Z20061216T021611Z.hdf":MODIS_Swath_Type_GEO:Height<br>&nbsp; SUBDATASET_1_DESC=[1620x1354] Height (16-bit integer)<br>&nbsp; SUBDATASET_2_NAME=HDF4_EOS:EOS_SWATH:"MOD03.Terra20061216T021152Z20061216T021611Z.hdf":MODIS_Swath_Type_GEO:SensorZenith<br>&nbsp; SUBDATASET_2_DESC=[1620x1354] SensorZenith (16-bit integer)<br>&nbsp; SUBDATASET_3_NAME=HDF4_EOS:EOS_SWATH:"MOD03.Terra20061216T021152Z20061216T021611Z.hdf":MODIS_Swath_Type_GEO:SensorAzimuth<br>&nbsp; SUBDATASET_3_DESC=[1620x1354] SensorAzimuth (16-bit integer)<br>&nbsp; SUBDATASET_4_NAME=HDF4_EOS:EOS_SWATH:"MOD03.Terra20061216T021152Z20061216T021611Z.hdf":MODIS_Swath_Type_GEO:Range<br>&nbsp; SUBDATASET_4_DESC=[1620x1354] Range (16-bit unsigned integer)<br>&nbsp; SUBDATASET_5_NAME=HDF4_EOS:EOS_SWATH:"MOD03.Terra20061216T021152Z20061216T021611Z.hdf":MODIS_Swath_Type_GEO:SolarZenith<br>&nbsp;
 SUBDATASET_5_DESC=[1620x1354] SolarZenith (16-bit integer)<br>&nbsp; SUBDATASET_6_NAME=HDF4_EOS:EOS_SWATH:"MOD03.Terra20061216T021152Z20061216T021611Z.hdf":MODIS_Swath_Type_GEO:SolarAzimuth<br>&nbsp; SUBDATASET_6_DESC=[1620x1354] SolarAzimuth (16-bit integer)<br>&nbsp; SUBDATASET_7_NAME=HDF4_EOS:EOS_SWATH:"MOD03.Terra20061216T021152Z20061216T021611Z.hdf":MODIS_Swath_Type_GEO:Land/SeaMask<br>&nbsp; SUBDATASET_7_DESC=[1620x1354] Land/SeaMask (8-bit unsigned integer)<br>&nbsp; SUBDATASET_8_NAME=HDF4_EOS:EOS_SWATH:"MOD03.Terra20061216T021152Z20061216T021611Z.hdf":MODIS_Swath_Type_GEO:gflags<br>&nbsp; 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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Index = 0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 Type= 32-bit floating point<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ref. = 20<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Rank = 2<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Number of attributes = 3<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim0: Name=nscans*10:MODIS_Swath_Type_GEO<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Size = 1620<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Scale Type = number-type not set<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Number of attributes = 0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim1: Name=mframes:MODIS_Swath_Type_GEO<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Size =
 1354<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Scale Type = number-type not set<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Number of attributes = 0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Attr0: Name = units<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Type = 8-bit signed char <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Count= 7<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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 &amp; thanks<br><br>Huw Lynch<br><br></div></div></body></html>