Spatial-Allocator for the raster_tool questions?

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

Hi,

There is documentation on how to do this here: https://github.com/CMASCenter/Spatial-Allocator/blob/master/docs/User_Manual/SA_ch04_raster.md#nlcd_LC

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:
nlcd_2011_landcover_2011_edition_2014_03_31.img
USGS NLCD Urban Imperviousness Files:
nlcd_2011_impervious_2011_edition_2014_03_31.img
USGS NLCD Tree Canopy Files:
nlcd2011_usfs_treecanopy_cartographic_3-31-2014.img
MODIS Landcover Tiled Files:
MCD12Q1.A2011001.h02v08.051.2012264183809.hdf
MCD12Q1.A2011001.h03v06.051.2012264183735.hdf
MCD12Q1.A2011001.h03v07.051.2012264184147.hdf

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:
https://www.mrlc.gov/data?f[0]=category%3Aland%20cover

Liz

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.
Cheers,
Chao

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.
Cheers,
Chao

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:

                                       Best.
                                       Chao

Hi,

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,
Elyse

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.