# Value Map Error in Urban Cooling Model

**URL:** <https://community.naturalcapitalalliance.org/t/value-map-error-in-urban-cooling-model/1463>\
**Category:** Software Support\
**Tags:** urban-cooling\
**Created:** [October 30, 2020, 8:29pm UTC](https://community.naturalcapitalalliance.org/t/value-map-error-in-urban-cooling-model/1463 "2020-10-30T20:29:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nic.keller](https://avatars.discourse-cdn.com/v4/letter/n/8491ac/32.png) [@nic.keller](https://community.naturalcapitalalliance.org/u/nic.keller)\
**Post date:** [October 30, 2020, 8:29pm UTC](https://community.naturalcapitalalliance.org/t/value-map-error-in-urban-cooling-model/1463/1 "2020-10-30T20:29:37Z")

</div>

We are receiving the following errors in our report when we run the Urban Cooling Model:

2020-10-30 16:16:21,158 utils.prepare\_workspace(111) INFO Writing log messages to C:/Users/Nicole/Desktop/DEVELOP/Sac\_InVEST\_Outputs\InVEST-Urban-Cooling-Model-log-2020-10-30–16\_16\_21.txt  
2020-10-30 16:16:21,170 model.\_logged\_target(1626) Level 100 Starting model with parameters:  
Arguments for InVEST natcap.invest.urban\_cooling\_model 3.8.9:  
aoi\_vector\_path C:/Users/Nicole/Desktop/InVEST Inputs/AoI\_UTM.shp  
biophysical\_table\_path C:/Users/Nicole/Desktop/InVEST Inputs/Biophysical\_Table.csv  
cc\_method factors  
cc\_weight\_albedo 0.2  
cc\_weight\_eti 0.2  
cc\_weight\_shade 0.6  
do\_valuation False  
green\_area\_cooling\_distance 400  
lulc\_raster\_path C:/Users/Nicole/Desktop/InVEST Inputs/LULC\_raster\_UTM.tif  
n\_workers -1  
ref\_eto\_raster\_path C:/Users/Nicole/Desktop/InVEST Inputs/ET\_mean\_UTM\_Copy.tif  
results\_suffix \_sac  
t\_air\_average\_radius 2000  
t\_ref 34.58  
uhi\_max 7.10  
workspace\_dir C:/Users/Nicole/Desktop/DEVELOP/Sac\_InVEST\_Outputs

2020-10-30 16:16:21,326 urban\_cooling\_model.execute(296) INFO Starting Urban Cooling Model  
2020-10-30 16:16:21,812 utils.\_log\_gdal\_errors(68) ERROR [errno 1] Deleting C:/Users/Nicole/Desktop/DEVELOP/Sac\_InVEST\_Outputs\intermediate\lulc\_sac.tif failed: Permission denied  
2020-10-30 16:16:21,813 utils.\_log\_gdal\_errors(68) ERROR [errno 1] Deleting C:/Users/Nicole/Desktop/DEVELOP/Sac\_InVEST\_Outputs\intermediate\lulc\_sac.tif.ovr failed: Permission denied  
2020-10-30 16:16:26,333 geoprocessing.align\_and\_resize\_raster\_stack(752) INFO 1 of 2 aligned: lulc\_sac.tif  
2020-10-30 16:16:31,979 geoprocessing.logger\_callback(3239) INFO Warp 38.0% complete C:/Users/Nicole/Desktop/DEVELOP/Sac\_InVEST\_Outputs\intermediate\ref\_eto\_sac.tif  
2020-10-30 16:16:37,028 geoprocessing.logger\_callback(3239) INFO Warp 92.0% complete C:/Users/Nicole/Desktop/DEVELOP/Sac\_InVEST\_Outputs\intermediate\ref\_eto\_sac.tif  
2020-10-30 16:16:37,446 geoprocessing.logger\_callback(3239) INFO Warp 100.0% complete C:/Users/Nicole/Desktop/DEVELOP/Sac\_InVEST\_Outputs\intermediate\ref\_eto\_sac.tif  
2020-10-30 16:16:38,681 geoprocessing.align\_and\_resize\_raster\_stack(752) INFO 2 of 2 aligned: ref\_eto\_sac.tif  
2020-10-30 16:16:38,682 geoprocessing.align\_and\_resize\_raster\_stack(754) INFO aligned all 2 rasters.  
2020-10-30 16:16:38,792 geoprocessing.raster\_calculator(375) INFO starting stats\_worker  
2020-10-30 16:16:38,800 geoprocessing.raster\_calculator(381) INFO started stats\_worker \<Thread(Thread-1185, started daemon 1528)\>  
2020-10-30 16:16:38,838 threading.run(870) DEBUG payload is None, terminating  
2020-10-30 16:16:38,838 geoprocessing.raster\_calculator(486) INFO Waiting for raster stats worker result.  
2020-10-30 16:16:38,840 Task.add\_task(731) ERROR Something went wrong when adding task reclassify to kc (1), terminating taskgraph.  
Traceback (most recent call last):  
File “site-packages\taskgraph\Task.py”, line 697, in add\_task  
File “site-packages\taskgraph\Task.py”, line 1174, in \_call  
File “site-packages\pygeoprocessing\geoprocessing.py”, line 1763, in reclassify\_raster  
File “site-packages\pygeoprocessing\geoprocessing.py”, line 424, in raster\_calculator  
File “site-packages\pygeoprocessing\geoprocessing.py”, line 1756, in \_map\_dataset\_to\_value\_op  
ValueError: The following 1 raster values [127] from “C:/Users/Nicole/Desktop/DEVELOP/Sac\_InVEST\_Outputs\intermediate\lulc\_sac.tif” do not have corresponding entries in the `value_map`: {0: 0, 1: 1, 2: 1, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1, 9: 1, 10: 1, 11: 1, 12: 1, 13: 1, 14: 1, 15: 1, 16: 1, 17: 1, 18: 1, 19: 1, 20: 1}  
2020-10-30 16:16:38,842 model.\_logged\_target(1632) ERROR Exception while executing \<function execute at 0x1ED01618\>  
Traceback (most recent call last):  
File “site-packages\natcap\invest\ui\model.py”, line 1629, in \_logged\_target  
File “site-packages\natcap\invest\urban\_cooling\_model.py”, line 398, in execute  
File “site-packages\taskgraph\Task.py”, line 697, in add\_task  
File “site-packages\taskgraph\Task.py”, line 1174, in \_call  
File “site-packages\pygeoprocessing\geoprocessing.py”, line 1763, in reclassify\_raster  
File “site-packages\pygeoprocessing\geoprocessing.py”, line 424, in raster\_calculator  
File “site-packages\pygeoprocessing\geoprocessing.py”, line 1756, in \_map\_dataset\_to\_value\_op  
ValueError: The following 1 raster values [127] from “C:/Users/Nicole/Desktop/DEVELOP/Sac\_InVEST\_Outputs\intermediate\lulc\_sac.tif” do not have corresponding entries in the `value_map`: {0: 0, 1: 1, 2: 1, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1, 9: 1, 10: 1, 11: 1, 12: 1, 13: 1, 14: 1, 15: 1, 16: 1, 17: 1, 18: 1, 19: 1, 20: 1}  
2020-10-30 16:16:38,843 model.\_logged\_target(1635) INFO Execution finished  
2020-10-30 16:16:38,850 utils.prepare\_workspace(117) INFO Elapsed time: 17.69s

This value of 127 it says doesn’t have a corresponding value is strange. It doesn’t actually exist in our raster. It seems be being created by the model? The lulc raster intermediate output has a box around our study area filled with zeroes and then a bunch of pixels around the edge of our study area that suddenly have the 127 values.

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/naturalcapitalproject/original/2X/f/fc520546a0eb44eb2457de6556cf0172b91b50a8.jpeg)

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [October 30, 2020, 11:51pm UTC](https://community.naturalcapitalalliance.org/t/value-map-error-in-urban-cooling-model/1463/2 "2020-10-30T23:51:54Z")

</div>

Hi @nic.keller,

Thanks for including your log! We’ve very recently improved how InVEST handles signed byte rasters (and also the text of reclassification errors like this), so could you try the development build linked below and see if that resolves the issue for you?

[https://storage.googleapis.com/releases.naturalcapitalproject.org/invest/3.8.9.post600+g93281903/InVEST\_3.8.9.post600+g93281903\_x64\_Setup.exe](https://storage.googleapis.com/releases.naturalcapitalproject.org/invest/3.8.9.post600+g93281903/InVEST_3.8.9.post600+g93281903_x64_Setup.exe)

Thanks!  
James

---

<div class="post-metadata">

**Author:** ![nic.keller](https://avatars.discourse-cdn.com/v4/letter/n/8491ac/32.png) [@nic.keller](https://community.naturalcapitalalliance.org/u/nic.keller)\
**Post date:** [November 2, 2020, 7:37pm UTC](https://community.naturalcapitalalliance.org/t/value-map-error-in-urban-cooling-model/1463/3 "2020-11-02T19:37:07Z")

</div>

So we ended up solving the problem by setting the NoData value to the mystery 127 when we exported our raster to .tiff.  
We also had to add a line in our attribute table with a Value of 0 and we called the category ‘Background’.

I don’t really know WHY these things solved the problem, but they did.

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [November 2, 2020, 9:19pm UTC](https://community.naturalcapitalalliance.org/t/value-map-error-in-urban-cooling-model/1463/4 "2020-11-02T21:19:31Z")

</div>

Well, I’m glad you were able to find a workaround!

Again, the handling of signed byte rasters should be dramatically improved in the forthcoming InVEST 3.9.0 release, for anyone coming across this thread in the future.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/naturalcapitalproject/original/2X/8/8d95591aa074da87ea0fdd61ca47c1c3c0588aa7.png) [@system](https://community.naturalcapitalalliance.org/u/system)\
**Post date:** [November 9, 2020, 9:19pm UTC](https://community.naturalcapitalalliance.org/t/value-map-error-in-urban-cooling-model/1463/5 "2020-11-09T21:19:36Z")

</div>

Closed on November 9, 2020, 9:19pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
