Hello!
First of all, I know that a similar topic already has been posted (Urban Flood Mitigation Error - ValueError: invalid entry in choice array) whereas a result, I think you did include the error message that I see now.
After initially running my model, the tool aborted after a few seconds with the error message of 'Value Error encountered: Invalid entry in choice array. Check that the Soil Group Raster does not contain values other than (1,2,3,4).
The problem is, that my soil group raster DOES NOT contain any other values than 1-4.
Screencap where you can see the attribute table of the soil raster:
Any idea what the problem could be? Maybe the error lies somewhere else?
I further tried creating a new, artificial soil raster file containing just 1 single soil type for the whole area of interest (only containing value 3, just like the example data), but ended up getting the same error nonetheless, so I suspect the problem might be a different one?
Log details:
Initializing…
Showing messages with level INFO and higher
2020-06-15 11:53:34,886 utils.prepare_workspace(111) INFO Writing log messages to D:/InVEST/The Hague Runs/Flooding/Run/Test1\InVEST-UrbanFloodRiskMitigation-log-2020-06-15–11_53_34.txt
2020-06-15 11:53:34,887 model._logged_target(1629) Level 100 Starting model with parameters:
Arguments for InVEST natcap.invest.urban_flood_risk_mitigation 3.8.2:
aoi_watersheds_path D:/InVEST/The Hague Runs/Flooding/Data/MiniHague.shp
built_infrastructure_vector_path
curve_number_table_path D:/InVEST/The Hague Runs/Flooding/Data/Biophysical Table.csv
infrastructure_damage_loss_table_path
lulc_path D:/InVEST/The Hague Runs/Flooding/Data/LULC_10x10_Hague.tif
n_workers -1
rainfall_depth 8
results_suffix test
soils_hydrological_group_raster_path D:/InVEST/The Hague Runs/Flooding/Data/Soilgroups_NA.tif
workspace_dir D:/InVEST/The Hague Runs/Flooding/Run/Test1
2020-06-15 11:53:35,006 geoprocessing.raster_calculator(375) INFO starting stats_worker
2020-06-15 11:53:35,007 geoprocessing.raster_calculator(381) INFO started stats_worker <Thread(Thread-15, started daemon 16624)>
2020-06-15 11:53:35,032 geoprocessing.raster_calculator(486) INFO Waiting for raster stats worker result.
2020-06-15 11:53:35,033 threading.run(870) WARNING No valid pixels were received, sending None.
2020-06-15 11:53:35,033 Task.add_task(626) ERROR Something went wrong when adding task create cn raster (1), terminating taskgraph.
Traceback (most recent call last):
File “site-packages\natcap\invest\urban_flood_risk_mitigation.py”, line 828, in _lu_to_cn_op
File “<array_function internals>”, line 6, in choose
File “site-packages\numpy\core\fromnumeric.py”, line 433, in choose
File “site-packages\numpy\core\fromnumeric.py”, line 61, in _wrapfunc
ValueError: invalid entry in choice array
During handling of the above exception, another exception occurred:
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 424, in raster_calculator
File “site-packages\natcap\invest\urban_flood_risk_mitigation.py”, line 832, in _lu_to_cn_op
ValueError: invalid entry in choice array
Check that the Soil Group raster does not contain values other than (1, 2, 3, 4)
2020-06-15 11:53:35,034 model._logged_target(1635) ERROR Exception while executing <function execute at 0x0FFA1C00>
Traceback (most recent call last):
File “site-packages\natcap\invest\urban_flood_risk_mitigation.py”, line 828, in _lu_to_cn_op
File “<array_function internals>”, line 6, in choose
File “site-packages\numpy\core\fromnumeric.py”, line 433, in choose
File “site-packages\numpy\core\fromnumeric.py”, line 61, in _wrapfunc
ValueError: invalid entry in choice array
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “site-packages\natcap\invest\ui\model.py”, line 1632, in _logged_target
File “site-packages\natcap\invest\urban_flood_risk_mitigation.py”, line 248, 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 424, in raster_calculator
File “site-packages\natcap\invest\urban_flood_risk_mitigation.py”, line 832, in _lu_to_cn_op
ValueError: invalid entry in choice array
Check that the Soil Group raster does not contain values other than (1, 2, 3, 4)
2020-06-15 11:53:35,035 model._logged_target(1638) INFO Execution finished
2020-06-15 11:53:35,041 utils.prepare_workspace(117) INFO Elapsed time: 0.16s
2020-06-15 11:53:35,058 execution.run(78) ERROR Target <function InVESTModel.execute_model.._logged_target at 0x01695A98> failed with exception
Traceback (most recent call last):
File “site-packages\natcap\invest\urban_flood_risk_mitigation.py”, line 828, in _lu_to_cn_op
File “<array_function internals>”, line 6, in choose
File “site-packages\numpy\core\fromnumeric.py”, line 433, in choose
File “site-packages\numpy\core\fromnumeric.py”, line 61, in _wrapfunc
ValueError: invalid entry in choice array
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “site-packages\natcap\invest\ui\execution.py”, line 68, in run
File “site-packages\natcap\invest\ui\model.py”, line 1632, in _logged_target
File “site-packages\natcap\invest\urban_flood_risk_mitigation.py”, line 248, 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 424, in raster_calculator
File “site-packages\natcap\invest\urban_flood_risk_mitigation.py”, line 832, in _lu_to_cn_op
ValueError: invalid entry in choice array
Check that the Soil Group raster does not contain values other than (1, 2, 3, 4)
2020-06-15 11:53:35,063 execution.run(83) INFO Execution finished
Thank you!