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 http://gis.fem-environment.eu/modis-sinusoidal-gis-files/.

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.

 

7 thoughts on “Opening MODIS tiles in QGIS

  1. Jens

    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!

    Reply
    1. pvanb Post author

      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.

      Reply
  2. Pingback: Ecostudies

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

  4. Pingback: Soporte HDF (Hierarchical Data Format) en GDAL de QGIS | El Blog de José Guerrero

  5. Amare

    Hi,
    I think I need more help on this. I want to use MODIS land cover data to generate rate of deforestation for many countries since 2000. I am an economist and my GIS skill is just beginner. I have hard time trying to follow some of the technical terms, but I am determined to learn everything that will enable me to find the data I need. Being a PhD student, I need this data badly. I would appreciate your help if you could please give me an outline of what I should do (like starting from something that looks like this: http://e4ftl01.cr.usgs.gov/MOTA/MCD12Q2.005/2001.01.01/ to having a column in a spreadsheet whose values are percentage of forest cover change for a series of years in different countries).
    Thank you for your time.

    Reply

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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