I am using the MOD04_L2 MODIS Aerosol Deep Blue product from the LAADS API. These files are in hdf4 format, but I am transforming them to hdf5. I did transform the files because I'm unable to compile gdal with hdf4 support, and I found this great command-line tool from the HDF Group that allows to easily translate files between versions.

All is good until there. But when I ran a gdalinfo I get this:

Files: Downloads/MOD04_L2.A2000055.0005.061.2017205182825.h5
Size is 512, 512
Coordinate System is `'

There is no CRS or coordinate information. The only relevant information is the Corner Coordinates:

Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  512.0)
Upper Right (  512.0,    0.0)
Lower Right (  512.0,  512.0)
Center      (  256.0,  256.0)

But there is not much I can do with that.

It is my first time working with the hdf format.

Is this missing data due to the modification of the file to hdf5?

The command-line utility is already compiled without documentation.


MODIS files are not HDF4, but HDF-EOS2 which is an extension of HDF4. In particular HDF-EOS2 provides support for swath data geolocation and MODIS Level 2 data is swath data.

Converting HDF-EOS2 with HDF4-tools risks dropping geolocation. For NPOESS data NASA developed HDF-EOS5 that is based on HDF5, however HDF-EOS5 geolocation support has not been implemented in GDAL yet. So there is no point in doing this altogether.

Consider getting GDAL binaries with HDF4 support or use NASA provided HDF-EOS To GeoTIFF Conversion Tool HEG tool to reproject MODIS Level 2 files into a gridded format. Note that popular MRTSwath tool for that purpose had been already retired as of February 28, 2019.

| improve this answer | |
  • Many thanks for your reply. I just discover that the LAADS NASA API allows the user to order the image in a GeoTiff format. Nonetheless, I still have some doubts about the use of this raster files. If I am comparing swaths across time, are the pixels consistent across space for each day? I've read some papers that re-grid the images in a 10x10km gridded pixel array for each day. – topcat May 20 '19 at 17:17
  • @topcat If you need to analyze the data over a period of time you might make use of the gridded MOD08_L3 atmospheric products reprojected onto MODIS regular grid. The pixels from different swaths do not match. In fact the orbits of the Terra and Aqua spacecrafts were calculated so that the swaths would repeat only once in 16 days. – Dmitri Chubarov May 20 '19 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.