Opening MODIS tiles in QGIS

NASA offers a very convenient web-based tool to select and download the tiles you need; Reverb / ECHO.  The tiles are in HDF format and use the Sinusoidal grid tiling system (proj4 definition: +proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181 +b=6371007.181 +units=m +no_defs). But you probably want to have the data in another data format and in another projection. NASA offers a very convenient cross-platform tool to reproject and convert the data (it also makes it very easy to mosaic tiles): the Modis Reprojection Tool (MRT).

But something I didn’t know is that it is also possible to open the tiles directly in QGIS. I tried before  but I was never able to open the HDF files. I am not sure it was a problem with GDAL (used by QGIS to open all the different spatial data layers) or one of the underlying libraries*, but in any case, I just tried again, and it works now. And if it works in QGIS, it will (should) work with all your GIS programs that use GDAL, for example GRASS GIS.

Opening A MODIS Thermal Anomalies (MYD14A2) tile. The data comes as a HDF and actually consists of two layers, one with detected fire occurrences and a QA layer.

QGIS with a MODIS raster layer opened. The grid gives the boundaries of the MODIS tiles and was downloaded from

Of course, opening the MODIS layers on top of other layers that use another project is not a problem in QGIS, just make sure to enable the “on the fly projection” option before opening the  MODIS tiles. You can do this clicking the little icon in the lower right corner. Next, check ‘Enable ‘on the fly’ CRS transformation and select the projection you want to use (e.g., latlon WGS 84 – EPGS 4326).

Now all layers you open will be displayed in that projection (provided that the layers contain information about their projection).


* GDAL need to be compiled with HDF4 support (using ./configure --with-hdf4). I had already done that, but I recently installed the latest version of GDAL (version 1.9.2), so perhaps that solved the problem. On the other hand, I also updated Ubuntu to 12.10, so maybe some of the libraries GDAL depend on were updated.


About pvanb

I am a tropical forest ecologist with a focus on spatial and temporal patterns and processes at population and ecosystem level. I am furthermore very interested in issues related to conservation and sustainable use of biodiversity and natural resources under current and future climates. I have worked in the Middle East (Syria and Lebanon) and South America (Brazil) and in Eastern Africa (Kenya).
This entry was posted in Data handling, GIS, QGIS and tagged , , , , . Bookmark the permalink.

5 Responses to Opening MODIS tiles in QGIS

  1. Jens says:

    Hi Pvanb, this sounds very interesting (as usual). I did not really understand what you changed in your GDAL settings. Does GDAL do the transformation to WGS84 directly while loading the HDF into QGIS? Could you give a short bullet point list of “HowTo?”. That would absolutely phantastic!
    thanks for posting this!

    • pvanb says:

      Hi Jens,

      I updated the post as I see I wasn’t clear. I did not change the GDAL settings, but I did update it to the latest version. I also updated Ubuntu, so it could be better support in GDAL or a change in the underlying libraries (e.g., libhdf4-tools, libhdf4), I am not sure.

      I also added a few lines on the ‘on the fly’ feature in QGIS. It basically transforms any layer you open directly to WGS84 (if that is the CRS you defined). But note, this is only for display purposes. To tranform your actual raster layer, you can use the gdal tools under raster-conversion and raster-projection to convert your layer to e.g., geotiff and reproject in the desired projection.

  2. Pingback: Ecostudies

  3. Pingback: Opening MODIS tiles in QGIS | Ecostudies | Vege...

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s