# Error with generateBeld4Data / computeGridLandUse\_beld4

**URL:** <https://forum.cmascenter.org/t/error-with-generatebeld4data-computegridlanduse-beld4/6290>\
**Category:** Spatial Allocator\
**Tags:** fest-c\
**Created:** [October 8, 2026, 7:05pm UTC](https://forum.cmascenter.org/t/error-with-generatebeld4data-computegridlanduse-beld4/6290 "2026-10-08T19:05:16Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![mkharkey](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@mkharkey](https://forum.cmascenter.org/u/mkharkey)\
**Post date:** [October 26, 2026, 5:30pm UTC](https://forum.cmascenter.org/t/error-with-generatebeld4data-computegridlanduse-beld4/6290/2 "2026-10-26T17:30:40Z")

</div>

I worked with Huan Fang to find the source of this error–the NLCD noData value has changed, so the new noData value of 250 was incorrectly mapped to open water. Huan made the following changes to the script, and it works correctly now.

original (with line numbers):  
2649 gridID = poImage\_grd[k];  
2650 classID = poImage[k];  
2651  
2652 if ( gridID \> 0 && gridID \<= gridPixels && classID != NoDataValue)  
2653 {  
2654 idIndex = nlcdIDS[classID]; //index in USGS NLCD ID pointer

should be:  
2649 gridID = poImage\_grd[k];  
2650 classID = poImage[k];  
2651  
2652 std::map\<int,int\>::const\_iterator it = nlcdIDS.find(classID);  
2653  
2654 if ( gridID \> 0 && gridID \<= gridPixels && it != nlcdIDS.end())  
2655 {  
2656 idIndex = it-\>second; //index in USGS NLCD ID pointer

---

_[View the full topic](https://forum.cmascenter.org/t/error-with-generatebeld4data-computegridlanduse-beld4/6290)._
