# Spatial-Allocator for the raster\_tool questions?

**URL:** <https://forum.cmascenter.org/t/spatial-allocator-for-the-raster-tool-questions/394>\
**Category:** Spatial Allocator\
**Created:** [November 5, 2018, 3:45pm UTC](https://forum.cmascenter.org/t/spatial-allocator-for-the-raster-tool-questions/394 "2018-11-05T15:45:33Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![gc13141112](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/gc13141112/32/78_2.png) [@gc13141112](https://forum.cmascenter.org/u/gc13141112)\
**Post date:** [November 5, 2018, 3:45pm UTC](https://forum.cmascenter.org/t/spatial-allocator-for-the-raster-tool-questions/394/1 "2018-11-05T15:45:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lizadams](https://avatars.discourse-cdn.com/v4/letter/l/49beb7/32.png) [@lizadams](https://forum.cmascenter.org/u/lizadams)\
**Post date:** [December 17, 2018, 6:36pm UTC](https://forum.cmascenter.org/t/spatial-allocator-for-the-raster-tool-questions/394/2 "2018-12-17T18:36:49Z")

</div>

> [@gc13141112](#):
>
> 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](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](https://www.mrlc.gov/data?f%5B0%5D=category%3Aland%20cover)

Liz

---

<div class="post-metadata">

**Author:** ![gc13141112](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/gc13141112/32/78_2.png) [@gc13141112](https://forum.cmascenter.org/u/gc13141112)\
**Post date:** [December 19, 2018, 1:49am UTC](https://forum.cmascenter.org/t/spatial-allocator-for-the-raster-tool-questions/394/3 "2018-12-19T01:49:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gc13141112](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/gc13141112/32/78_2.png) [@gc13141112](https://forum.cmascenter.org/u/gc13141112)\
**Post date:** [December 19, 2018, 1:51am UTC](https://forum.cmascenter.org/t/spatial-allocator-for-the-raster-tool-questions/394/4 "2018-12-19T01:51:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gc13141112](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/gc13141112/32/78_2.png) [@gc13141112](https://forum.cmascenter.org/u/gc13141112)\
**Post date:** [December 19, 2018, 2:16am UTC](https://forum.cmascenter.org/t/spatial-allocator-for-the-raster-tool-questions/394/5 "2018-12-19T02:16:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lizadams](https://avatars.discourse-cdn.com/v4/letter/l/49beb7/32.png) [@lizadams](https://forum.cmascenter.org/u/lizadams)\
**Post date:** [December 20, 2018, 3:30pm UTC](https://forum.cmascenter.org/t/spatial-allocator-for-the-raster-tool-questions/394/6 "2018-12-20T15:30:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gc13141112](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/gc13141112/32/78_2.png) [@gc13141112](https://forum.cmascenter.org/u/gc13141112)\
**Post date:** [December 21, 2018, 1:31am UTC](https://forum.cmascenter.org/t/spatial-allocator-for-the-raster-tool-questions/394/7 "2018-12-21T01:31:22Z")

</div>

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

```
                                       Best.
                                       Chao
```

---

<div class="post-metadata">

**Author:** ![epenning](https://avatars.discourse-cdn.com/v4/letter/e/da6949/32.png) [@epenning](https://forum.cmascenter.org/u/epenning)\
**Post date:** [June 28, 2019, 11:10pm UTC](https://forum.cmascenter.org/t/spatial-allocator-for-the-raster-tool-questions/394/8 "2019-06-28T23:10:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pkasper](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/pkasper/32/201_2.png) [@pkasper](https://forum.cmascenter.org/u/pkasper)\
**Post date:** [July 1, 2019, 11:56pm UTC](https://forum.cmascenter.org/t/spatial-allocator-for-the-raster-tool-questions/394/9 "2019-07-01T23:56:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![younggming](https://avatars.discourse-cdn.com/v4/letter/y/df788c/32.png) [@younggming](https://forum.cmascenter.org/u/younggming)\
**Post date:** [August 10, 2020, 5:57am UTC](https://forum.cmascenter.org/t/spatial-allocator-for-the-raster-tool-questions/394/10 "2020-08-10T05:57:16Z")

</div>

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

> **[HDF4 Error Spatial Allocator](https://forum.hdfgroup.org/t/hdf4-error-spatial-allocator/5992/2)**
>
> UPDATE: I’ve gotten past the generic HDF4 Error with some help from CMAS Here is what I was directed to do: Use h4dump (ncdump for h4 file in Spatial Allocator alias) to check the variable name in your file. The old MODIS file variable is:...
