# Urban Cooling Model, map values to raster error

**URL:** <https://community.naturalcapitalalliance.org/t/urban-cooling-model-map-values-to-raster-error/1064>\
**Category:** Software Support\
**Tags:** urban-cooling\
**Created:** [June 14, 2020, 10:09pm UTC](https://community.naturalcapitalalliance.org/t/urban-cooling-model-map-values-to-raster-error/1064 "2020-06-14T22:09:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MartijnS](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@MartijnS](https://community.naturalcapitalalliance.org/u/MartijnS)\
**Post date:** [June 14, 2020, 10:09pm UTC](https://community.naturalcapitalalliance.org/t/urban-cooling-model-map-values-to-raster-error/1064/1 "2020-06-14T22:09:03Z")

</div>

Hi Everyone,

I am running the inVEST ‘Urban Cooling Model’ version 3.8.3 and get some errors at the end. Ill hope these errors make some sense!

We are using the following data as input for the model:

• Landcover data from the Urban Atlas 2012  
• Evaporation data from: Global\_Aridity\_Index\_and\_Potential\_Evapotranspiration\_ET0\_Climate\_Database\_v27504448\7e6702721528d57a8f395a6721985feb0fb17464\et0\_month  
• Temperature from: ECWMF, ECMWF is the European Centre for Medium-Range Weather Forecasts. TEMPenDEWPOINTTEMPjuli2016avg1500h.nc  
• For calculating the shade we use the Tree Cover Density(TCD) from Copernicus

All raster data have a cell size of 20 x 20 m and is projected at ETRS\_1989\_LAEA. We rebuild the biophysical-table with default values for: albedo, kc, green\_area and building\_intensity. For shade we use tcd calculated per landcover type.

We rebuild the biophysical table in python referring from the default biophysical and adding the tcd dynamicly and do so later for other values.

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/naturalcapitalproject/original/1X/b4a22c61329fa5ffa510b5aecd7c17941d719b8a.png)

Following the complete logfile:

2020-06-14 00:44:14,604 utils.prepare\_workspace(111) INFO Writing log messages to Y:/Project/E555149\_H2020\_NATURVATION/Data/Urban\_atlas\_2012/InVEST\_modelrun\InVEST-Urban-Cooling-Model-log-2020-06-14–00\_44\_14.txt  
2020-06-14 00:44:14,606 model.\_logged\_target(1629) Level 100 Starting model with parameters:  
Arguments for InVEST natcap.invest.urban\_cooling\_model 3.8.3:  
aoi\_vector\_path Y:\Project\E555149\_H2020\_NATURVATION\Data\Urban\_atlas\_2012\model\_run\_1fua\FR001L1\_lc\_boundary.shp  
biophysical\_table\_path Y:\Project\E555149\_H2020\_NATURVATION\Data\Urban\_atlas\_2012\model\_run\_1fua\FR001L1\_biophysical.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 1000  
lulc\_raster\_path Y:\Project\E555149\_H2020\_NATURVATION\Data\Urban\_atlas\_2012\model\_run\_1fua\FR001L1\_LC.tif  
n\_workers -1  
ref\_eto\_raster\_path Y:\Project\E555149\_H2020\_NATURVATION\Data\Urban\_atlas\_2012\model\_run\_1fua\FR001L1\_evap\_prj.tif  
results\_suffix FR001L1  
t\_air\_average\_radius 2000  
t\_ref 23.97  
uhi\_max 2.90  
workspace\_dir Y:/Project/E555149\_H2020\_NATURVATION/Data/Urban\_atlas\_2012/InVEST\_modelrun

2020-06-14 00:44:14,607 urban\_cooling\_model.execute(295) INFO Starting Urban Cooling Model  
2020-06-14 00:44:20,927 geoprocessing.logger\_callback(3239) INFO Warp 1.0% complete Y:/Project/E555149\_H2020\_NATURVATION/Data/Urban\_atlas\_2012/InVEST\_modelrun\intermediate\lulc\_FR001L1.tif

\<\< skiped the next 98 lines \>\>

2020-06-14 00:52:52,078 geoprocessing.logger\_callback(3239) INFO Warp 100.0% complete Y:/Project/E555149\_H2020\_NATURVATION/Data/Urban\_atlas\_2012/InVEST\_modelrun\intermediate\lulc\_FR001L1.tif  
2020-06-14 00:52:52,576 geoprocessing.align\_and\_resize\_raster\_stack(752) INFO 1 of 2 aligned: lulc\_FR001L1.tif  
2020-06-14 00:52:57,640 geoprocessing.logger\_callback(3239) INFO Warp 42.0% complete Y:/Project/E555149\_H2020\_NATURVATION/Data/Urban\_atlas\_2012/InVEST\_modelrun\intermediate\ref\_eto\_FR001L1.tif  
2020-06-14 00:53:02,657 geoprocessing.logger\_callback(3239) INFO Warp 82.0% complete Y:/Project/E555149\_H2020\_NATURVATION/Data/Urban\_atlas\_2012/InVEST\_modelrun\intermediate\ref\_eto\_FR001L1.tif  
2020-06-14 00:53:04,633 geoprocessing.logger\_callback(3239) INFO Warp 100.0% complete Y:/Project/E555149\_H2020\_NATURVATION/Data/Urban\_atlas\_2012/InVEST\_modelrun\intermediate\ref\_eto\_FR001L1.tif  
2020-06-14 00:53:05,096 geoprocessing.align\_and\_resize\_raster\_stack(752) INFO 2 of 2 aligned: ref\_eto\_FR001L1.tif  
2020-06-14 00:53:05,097 geoprocessing.align\_and\_resize\_raster\_stack(754) INFO aligned all 2 rasters.  
2020-06-14 00:53:05,238 geoprocessing.raster\_calculator(375) INFO starting stats\_worker  
2020-06-14 00:53:05,240 geoprocessing.raster\_calculator(381) INFO started stats\_worker \<Thread(Thread-10, started daemon 5232)\>  
2020-06-14 00:53:05,267 threading.run(870) DEBUG payload is None, terminating  
2020-06-14 00:53:05,266 geoprocessing.raster\_calculator(486) INFO Waiting for raster stats worker result.  
2020-06-14 00:53:05,268 threading.run(870) WARNING No valid pixels were received, sending None.  
2020-06-14 00:53:05,269 Task.add\_task(626) 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 592, in add\_task  
File “site-packages\taskgraph\Task.py”, line 1069, 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 [1] from “Y:/Project/E555149\_H2020\_NATURVATION/Data/Urban\_atlas\_2012/InVEST\_modelrun\intermediate\lulc\_FR001L1.tif” do not have corresponding entries in the `value_map`: {11100: 0.18, 11210: 0.31, 11220: 0.53, 11230: 0.71, 11240: 0.81, 11300: 0.81, 12100: 0.31, 12210: 0.35, 12220: 0.35, 12230: 0.35, 12300: 0.4, 12400: 0.4, 13100: 0.28, 13300: 0.28, 13400: 0.75, 14100: 0.89, 14200: 0.75, 21000: 0.75, 22000: 0.75, 23000: 0.75, 24000: 0.75, 25000: 0.75, 31000: 1.0, 32000: 0.75, 33000: 0.28, 40000: 0.75, 50000: 0.27, 91000: 0.0}  
2020-06-14 00:53:05,271 model.\_logged\_target(1635) ERROR Exception while executing \<function execute at 0x12BE6C48\>  
Traceback (most recent call last):  
File “site-packages\natcap\invest\ui\model.py”, line 1632, in \_logged\_target  
File “site-packages\natcap\invest\urban\_cooling\_model.py”, line 383, in execute  
File “site-packages\taskgraph\Task.py”, line 592, in add\_task  
File “site-packages\taskgraph\Task.py”, line 1069, 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 [1] from “Y:/Project/E555149\_H2020\_NATURVATION/Data/Urban\_atlas\_2012/InVEST\_modelrun\intermediate\lulc\_FR001L1.tif” do not have corresponding entries in the `value_map`: {11100: 0.18, 11210: 0.31, 11220: 0.53, 11230: 0.71, 11240: 0.81, 11300: 0.81, 12100: 0.31, 12210: 0.35, 12220: 0.35, 12230: 0.35, 12300: 0.4, 12400: 0.4, 13100: 0.28, 13300: 0.28, 13400: 0.75, 14100: 0.89, 14200: 0.75, 21000: 0.75, 22000: 0.75, 23000: 0.75, 24000: 0.75, 25000: 0.75, 31000: 1.0, 32000: 0.75, 33000: 0.28, 40000: 0.75, 50000: 0.27, 91000: 0.0}  
2020-06-14 00:53:05,274 model.\_logged\_target(1638) INFO Execution finished  
2020-06-14 00:53:05,278 utils.prepare\_workspace(117) INFO Elapsed time: 8m 50.66999999999996s

---

<div class="post-metadata">

**Author:** ![dcdenu4](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dcdenu4/32/544_2.png) [@dcdenu4](https://community.naturalcapitalalliance.org/u/dcdenu4)\
**Post date:** [June 15, 2020, 12:08pm UTC](https://community.naturalcapitalalliance.org/t/urban-cooling-model-map-values-to-raster-error/1064/2 "2020-06-15T12:08:07Z")

</div>

Hi @MartijnS,

It looks like the Landcover data Urban Atlas 2012 has a pixel value of 1 somewhere that does not have a corresponding row in the biophysical table. Could you check that LULC does indeed have this pixel value of 1 using QGIS or ArcGIS and then make sure it is accounted for in the biophysical table? It also looks like the LULC values are quite large `11100, 11210, 111230, ...` just wanted to make sure that was intended.

Let us know if you’re still having issues and not getting or seeing what you expect.

`The following 1 raster values [1] from “Y:/Project/E555149_H2020_NATURVATION/Data/Urban_atlas_2012/InVEST_modelrun\intermediate\lulc_FR001L1.tif” do not have corresponding entries in the `value\_map`: {11100: 0.18, 11210: 0.31, 11220: 0.53, 11230: 0.71, 11240: 0.81, 11300: 0.81, 12100: 0.31, 12210: 0.35, 12220: 0.35, 12230: 0.35, 12300: 0.4, 12400: 0.4, 13100: 0.28, 13300: 0.28, 13400: 0.75, 14100: 0.89, 14200: 0.75, 21000: 0.75, 22000: 0.75, 23000: 0.75, 24000: 0.75, 25000: 0.75, 31000: 1.0, 32000: 0.75, 33000: 0.28, 40000: 0.75, 50000: 0.27, 91000: 0.0}`

Doug

---

<div class="post-metadata">

**Author:** ![Hesch1201](https://avatars.discourse-cdn.com/v4/letter/h/d2c977/32.png) [@Hesch1201](https://community.naturalcapitalalliance.org/u/Hesch1201)\
**Post date:** [June 17, 2020, 10:37am UTC](https://community.naturalcapitalalliance.org/t/urban-cooling-model-map-values-to-raster-error/1064/3 "2020-06-17T10:37:58Z")

</div>

Hello @MartijnS,

I am also working with the Urban Cooling Model v. 3.8.0 and Landcover data from Urban Atlas 2012 and have the same Error. The only difference is the line:  
“The following 1 raster values [1]…”  
I’ve got:  
“The following 1 raster values [0]…”

Did you figuered something out already and if so, could you share your solution? Thanks

---

<div class="post-metadata">

**Author:** ![dcdenu4](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dcdenu4/32/544_2.png) [@dcdenu4](https://community.naturalcapitalalliance.org/u/dcdenu4)\
**Post date:** [June 17, 2020, 11:40am UTC](https://community.naturalcapitalalliance.org/t/urban-cooling-model-map-values-to-raster-error/1064/4 "2020-06-17T11:40:38Z")

</div>

Hi @Hesch1201,

Thanks for the post to this thread. Do you think you could share the landcover raster and biophysical table? I’d be happy to take a look at them to see if anything looks suspicious. Outside of that, if you or @MartijnS would be willing to share all your inputs I could try and reproduce the error on my end and go from there.

Doug

---

<div class="post-metadata">

**Author:** ![MartijnS](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@MartijnS](https://community.naturalcapitalalliance.org/u/MartijnS)\
**Post date:** [June 17, 2020, 12:37pm UTC](https://community.naturalcapitalalliance.org/t/urban-cooling-model-map-values-to-raster-error/1064/5 "2020-06-17T12:37:39Z")

</div>

Hoi Doug,

Yea, looks like we have a common issue. Ill guess it has something to do which field InVEST is using from the landcover raster. I’ll think it is using the Value field instead of using the landcover code(code2012) field. By doing so, the corresponding field values differs between the input raster’s(shade, albedo, evap, temp) and the biophysical table, since we use the code2012 as lucl code in the biotable. As result, the corresponding evap raster(ref\_eto\_FR001L1) and Kc(kc\_FR001L1) are empty as the values in the invest rasters aren’t comparable. The only file that seems to be well finished is lulc\_FR001L1( based on the urban landcover raster) but it is using the Value field instead of the desired landcover code(code2012).

So, I am thinking to reclass the urban raster( the code2012 to field Value) and adjust the biophysical table to use those same values instead of using code2012. It`s a bit of a detour ;(

Good luck, i hope this will fix the issue, if not, please let me know.

Regards, Martijn

---

<div class="post-metadata">

**Author:** ![dcdenu4](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dcdenu4/32/544_2.png) [@dcdenu4](https://community.naturalcapitalalliance.org/u/dcdenu4)\
**Post date:** [June 17, 2020, 3:12pm UTC](https://community.naturalcapitalalliance.org/t/urban-cooling-model-map-values-to-raster-error/1064/6 "2020-06-17T15:12:29Z")

</div>

Hi Martijn,

Yes, that’s correct. InVEST expects to use the Landcover raster pixel VALUE to relate to the biophysical table lucodes. So if you had Landcover raster values of 1,2,3,4,5 it would expect lucodes in the biophysical table to be 1,2,3,4,5.

Let us know if you have any other issues and if there should be an update to the User’s Guide to make this more clear.

Doug
