Spatial-Allocator for the raster_tool questions?

How can I use the computeGridLandUse.exe to process MODIS Collection 6 MCD12Q1 land cover data?


There is documentation on how to do this here:

The following script: NLCD_MODIS_processor.csh has been provided. The nlcd_modis_files_2011.txt file that is provided lists the input data that is required and that must be downloaded using the links provided in the documentation.

cat nlcd_modis_files_2011.txt
USGS NLCD Landuse Files:
USGS NLCD Urban Imperviousness Files:
USGS NLCD Tree Canopy Files:
MODIS Landcover Tiled Files:

Please let us know if you have tried these steps, and/or what issues you are having.
I did see that the link that we provided to download the NLCD 2006 data 2011 edition, no longer works.
Please try this link instead:[0]=category%3Aland%20cover


1 Like

Dear Liz:
Thank you for your reply!
I can successfully process the MCD12Q1 data of version 5.1, but I don’t process the MCD12Q1 data of version 6.

Dear Liz:
Thank you for your reply!
I can successfully process the MCD12Q1 data of version 5.1, but I did’t process the MCD12Q1 data of version 6.

this is my error:

Obtaining image variable information: Land_Cover_Type_1 from /public/model/SA/Spatial-Allocator-master/data/MCD12Q1/2017/MCD12Q1.A2017001.h00v08.006.2018257170130.hdf
HDF4 error

We recommend using 2011 MODIS data for your work.
The 2017 data hasn’t been tested yet, and there may need to be updates to the code.
If you do run into trouble with the 2011 data, be sure that it isn’t a problem related to unzipping the zip files.
We have run into issues with unzip only partially unzipping the files, resulting in the file sizes being uncharacteristically small. Try unzipping the file on multiple platforms (windows, linux) and make sure the file sizes are the same.

Thank you very much !
I also successfully process 2011 MODIS data of version 5. Looking forward to updating your code.:slightly_smiling_face:



I’m getting the same error as described above:

Obtaining image variable information: Land_Cover_Type_1 from /central/groups/seinfeldgroup/Spatial-Allocator_old/data/beld4/MODIS/MCD12Q1.A2012001.h19v05.006.2018055002925.hdf
Number of the global attributes: 6

HDF4 error

I have tried using a different version of hdf4 that’s installed on my shared computer (and have successfully rebuilt the raster tools using this new library) and get the same error. I think I am using 2012 MODIS data and not 2017, and partially unzipping the files is not the problem. How can we tell whether we are using version 5 or 6 of the data?

Thank you,

There seems to be a number of problems with people getting the raster tool to work (I myself have similar problem as above getting the hdf4 error). I want to know for those who have successfully run the raster tool what problems you have run into and what you have done to fix your problems to see if there is something that I am doing incorrectly.

The HDF4 error shoud be associated to the variable name of MODIS version 6.
This might be helpful.