Urban Cooling Model, map values to raster error

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.

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

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

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

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

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

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