# Urban Flood Risk Mitigation Model Problem in Soil Group Raster

**URL:** <https://community.naturalcapitalalliance.org/t/urban-flood-risk-mitigation-model-problem-in-soil-group-raster/3161>\
**Category:** Software Support\
**Tags:** urban-flood\
**Created:** [October 28, 2022, 7:55am UTC](https://community.naturalcapitalalliance.org/t/urban-flood-risk-mitigation-model-problem-in-soil-group-raster/3161 "2022-10-28T07:55:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![r4mle](https://avatars.discourse-cdn.com/v4/letter/r/7bcc69/32.png) [@r4mle](https://community.naturalcapitalalliance.org/u/r4mle)\
**Post date:** [October 28, 2022, 7:55am UTC](https://community.naturalcapitalalliance.org/t/urban-flood-risk-mitigation-model-problem-in-soil-group-raster/3161/1 "2022-10-28T07:55:37Z")

</div>

### Hello, I’m running the 3.11.0 model for urban flood risk mitigation model problem, I don’t know that to do because my Soil Hydrologic Group data only 3, 4, 13 and 14 but then the model needs only values 1-4, and I really don’t know what to do.

2022-10-28 15:44:53,310 (natcap.invest.utils) utils.prepare\_workspace(162) Level 100 Writing log messages to [C:\Users\63916\Documents\ArcGIS\thesis 3\InVEST-natcap.invest.urban\_flood\_risk\_mitigation-log-2022-10-28–15\_44\_53.txt]  
2022-10-28 15:44:53,310 ( **main** ) cli.main(475) Level 100 Starting model with parameters:  
Arguments for InVEST natcap.invest.urban\_flood\_risk\_mitigation 3.11.0:  
aoi\_watersheds\_path F:\Downloads\Shapefils\Map\City\_of\_Marikina.shp  
built\_infrastructure\_vector\_path  
curve\_number\_table\_path F:\Downloads\CSV. Thesis7 - Sheet1.csv  
infrastructure\_damage\_loss\_table\_path  
lulc\_path F:\Downloads\Shapefils\51P\_20210101-20220101.tif  
n\_workers -1  
rainfall\_depth 212.15  
results\_suffix first  
soils\_hydrological\_group\_raster\_path F:\Downloads\Shapefils\soil hydroligic group\SHG31.tif  
workspace\_dir C:\Users\63916\Documents\ArcGIS\thesis 3

2022-10-28 15:44:53,310 (natcap.invest.validation) validation.\_wrapped\_validate\_func(1030) INFO Starting whole-model validation with ARGS\_SPEC  
2022-10-28 15:44:53,473 (pygeoprocessing.geoprocessing) geoprocessing.align\_and\_resize\_raster\_stack(824) INFO 1 of 2 aligned: aligned\_lulc\_first.tif  
2022-10-28 15:44:53,508 (pygeoprocessing.geoprocessing) geoprocessing.align\_and\_resize\_raster\_stack(824) INFO 2 of 2 aligned: aligned\_soils\_hydrological\_group\_first.tif  
2022-10-28 15:44:53,508 (pygeoprocessing.geoprocessing) geoprocessing.align\_and\_resize\_raster\_stack(828) INFO aligned all 2 rasters.  
2022-10-28 15:44:53,531 (pygeoprocessing.geoprocessing) geoprocessing.raster\_calculator(396) INFO starting stats\_worker  
2022-10-28 15:44:53,532 (pygeoprocessing.geoprocessing) geoprocessing.raster\_calculator(402) INFO started stats\_worker \<Thread(Thread-6 (stats\_worker), started daemon 16748)\>  
2022-10-28 15:44:53,539 (pygeoprocessing.geoprocessing) geoprocessing.raster\_calculator(498) ERROR exception encountered in raster\_calculator  
Traceback (most recent call last):  
File “natcap\invest\urban\_flood\_risk\_mitigation.py”, line 812, in \_lu\_to\_cn\_op  
File “\< **array\_function** internals\>”, line 180, in choose  
File “numpy\core\fromnumeric.py”, line 429, in choose  
File “numpy\core\fromnumeric.py”, line 57, in \_wrapfunc  
ValueError: invalid entry in choice array

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “pygeoprocessing\geoprocessing.py”, line 443, in raster\_calculator  
File “natcap\invest\urban\_flood\_risk\_mitigation.py”, line 819, 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)  
2022-10-28 15:44:53,540 (pygeoprocessing.geoprocessing) geoprocessing.raster\_calculator(513) INFO Waiting for raster stats worker result.  
2022-10-28 15:44:53,541 (pygeoprocessing.geoprocessing\_core) threading.run(946) WARNING No valid pixels were received, sending None.  
2022-10-28 15:44:53,541 (taskgraph.Task) Task.add\_task(706) ERROR Something went wrong when adding task create Curve Number raster (1), terminating taskgraph.  
Traceback (most recent call last):  
File “natcap\invest\urban\_flood\_risk\_mitigation.py”, line 812, in \_lu\_to\_cn\_op  
File “\< **array\_function** internals\>”, line 180, in choose  
File “numpy\core\fromnumeric.py”, line 429, in choose  
File “numpy\core\fromnumeric.py”, line 57, in \_wrapfunc  
ValueError: invalid entry in choice array

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “taskgraph\Task.py”, line 674, in add\_task  
File “taskgraph\Task.py”, line 1093, in \_call  
File “pygeoprocessing\geoprocessing.py”, line 443, in raster\_calculator  
File “natcap\invest\urban\_flood\_risk\_mitigation.py”, line 819, 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)  
2022-10-28 15:44:53,542 (natcap.invest.utils) utils.prepare\_workspace(167) ERROR Exception while executing natcap.invest.urban\_flood\_risk\_mitigation  
Traceback (most recent call last):  
File “natcap\invest\urban\_flood\_risk\_mitigation.py”, line 812, in \_lu\_to\_cn\_op  
File “\< **array\_function** internals\>”, line 180, in choose  
File “numpy\core\fromnumeric.py”, line 429, in choose  
File “numpy\core\fromnumeric.py”, line 57, in \_wrapfunc  
ValueError: invalid entry in choice array

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 165, in prepare\_workspace  
File “natcap\invest\cli.py”, line 486, in main  
File “natcap\invest\urban\_flood\_risk\_mitigation.py”, line 235, in execute  
File “taskgraph\Task.py”, line 674, in add\_task  
File “taskgraph\Task.py”, line 1093, in \_call  
File “pygeoprocessing\geoprocessing.py”, line 443, in raster\_calculator  
File “natcap\invest\urban\_flood\_risk\_mitigation.py”, line 819, 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)  
2022-10-28 15:44:53,543 (natcap.invest.utils) utils.prepare\_workspace(170) INFO Elapsed time: 0.23s  
2022-10-28 15:44:53,543 (natcap.invest.utils) utils.prepare\_workspace(173) INFO Execution finished

### I have tried making it values from 1 to 4 but then this happened only 1 value was processed from the model. This is the processed I made

2022-10-28 13:06:05,726 (natcap.invest.utils) utils.prepare\_workspace(162) Level 100 Writing log messages to [C:\Users\63916\Documents\ArcGIS\Thesis\InVEST-natcap.invest.urban\_flood\_risk\_mitigation-log-2022-10-28–13\_06\_05.txt]  
2022-10-28 13:06:05,726 ( **main** ) cli.main(475) Level 100 Starting model with parameters:  
Arguments for InVEST natcap.invest.urban\_flood\_risk\_mitigation 3.11.0:  
aoi\_watersheds\_path F:\Downloads\Shapefils\Map\City\_of\_Marikina.shp  
built\_infrastructure\_vector\_path  
curve\_number\_table\_path F:\Downloads\CSV. Thesis - Sheet1.csv  
infrastructure\_damage\_loss\_table\_path  
lulc\_path F:\Downloads\Shapefils\51P\_20210101-20220101.tif  
n\_workers -1  
rainfall\_depth 241.98  
results\_suffix first  
soils\_hydrological\_group\_raster\_path F:\Downloads\Shapefils\soil hydroligic group\SHG1.tif  
workspace\_dir C:\Users\63916\Documents\ArcGIS\Thesis

2022-10-28 13:06:05,727 (natcap.invest.validation) validation.\_wrapped\_validate\_func(1030) INFO Starting whole-model validation with ARGS\_SPEC  
2022-10-28 13:06:05,882 (pygeoprocessing.geoprocessing) geoprocessing.raster\_calculator(396) INFO starting stats\_worker  
2022-10-28 13:06:05,883 (pygeoprocessing.geoprocessing) geoprocessing.raster\_calculator(402) INFO started stats\_worker \<Thread(Thread-6 (stats\_worker), started daemon 16672)\>  
2022-10-28 13:06:05,915 (pygeoprocessing.geoprocessing) geoprocessing.raster\_calculator(498) ERROR exception encountered in raster\_calculator  
Traceback (most recent call last):  
File “pygeoprocessing\geoprocessing.py”, line 443, in raster\_calculator  
File “natcap\invest\urban\_flood\_risk\_mitigation.py”, line 795, in \_lu\_to\_cn\_op  
ValueError: The biophysical table is missing a row for lucode(s) [10]  
2022-10-28 13:06:05,917 (pygeoprocessing.geoprocessing) geoprocessing.raster\_calculator(513) INFO Waiting for raster stats worker result.  
2022-10-28 13:06:05,917 (pygeoprocessing.geoprocessing\_core) threading.run(946) WARNING No valid pixels were received, sending None.  
2022-10-28 13:06:05,917 (taskgraph.Task) Task.add\_task(706) ERROR Something went wrong when adding task create Curve Number raster (1), terminating taskgraph.  
Traceback (most recent call last):  
File “taskgraph\Task.py”, line 674, in add\_task  
File “taskgraph\Task.py”, line 1093, in \_call  
File “pygeoprocessing\geoprocessing.py”, line 443, in raster\_calculator  
File “natcap\invest\urban\_flood\_risk\_mitigation.py”, line 795, in \_lu\_to\_cn\_op  
ValueError: The biophysical table is missing a row for lucode(s) [10]  
2022-10-28 13:06:05,918 (natcap.invest.utils) utils.prepare\_workspace(167) ERROR Exception while executing natcap.invest.urban\_flood\_risk\_mitigation  
Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 165, in prepare\_workspace  
File “natcap\invest\cli.py”, line 486, in main  
File “natcap\invest\urban\_flood\_risk\_mitigation.py”, line 235, in execute  
File “taskgraph\Task.py”, line 674, in add\_task  
File “taskgraph\Task.py”, line 1093, in \_call  
File “pygeoprocessing\geoprocessing.py”, line 443, in raster\_calculator  
File “natcap\invest\urban\_flood\_risk\_mitigation.py”, line 795, in \_lu\_to\_cn\_op  
ValueError: The biophysical table is missing a row for lucode(s) [10]  
2022-10-28 13:06:05,919 (natcap.invest.utils) utils.prepare\_workspace(170) INFO Elapsed time: 0.19s  
2022-10-28 13:06:05,919 (natcap.invest.utils) utils.prepare\_workspace(173) INFO Execution finished

---

<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 28, 2022, 11:29pm UTC](https://community.naturalcapitalalliance.org/t/urban-flood-risk-mitigation-model-problem-in-soil-group-raster/3161/2 "2022-10-28T23:29:19Z")

</div>

Welcome to the forums @r4mle !

This more recent error: **ValueError: The biophysical table is missing a row for lucode(s) [10]** is reporting something different, which is that your biophysical is missing an entry for lucode `10`. Could you check your biophysical table and make sure that there’s an entry for lucode 10? Also feel free to attach your biophysical table here if you’d like and we’ll be happy to take a look.

James

---

<div class="post-metadata">

**Author:** ![r4mle](https://avatars.discourse-cdn.com/v4/letter/r/7bcc69/32.png) [@r4mle](https://community.naturalcapitalalliance.org/u/r4mle)\
**Post date:** [December 1, 2022, 6:55am UTC](https://community.naturalcapitalalliance.org/t/urban-flood-risk-mitigation-model-problem-in-soil-group-raster/3161/3 "2022-12-01T06:55:49Z")

</div>

Hello, I already have the results thank you for helping

I have more question, the value needed for the Rainfall Depth, is that annually or monthly?

---

<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:** [December 5, 2022, 1:33am UTC](https://community.naturalcapitalalliance.org/t/urban-flood-risk-mitigation-model-problem-in-soil-group-raster/3161/4 "2022-12-05T01:33:59Z")

</div>

@r4mle it really depends on the storm you’re trying to model (the “design storm”). From the [user’s guide appendix:](https://storage.googleapis.com/releases.naturalcapitalproject.org/invest-userguide/latest/urban_flood_mitigation.html#depth-of-rainfall-for-design-storm)

> Depth of Rainfall for Design Storm
> 
> A design storm is a hypothetical rainstorm used for modeling purposes. The design storm precipitation value should be chosen according to the area and goals. For instance, it could be the average precipitation per rain event, the precipitation at a certain percentile, or the maximum precipitation expected to occur once in 100 years.
> 
> To calculate the design storm, users can look up intensity-frequency-duration (IFD) tables available for their city. The storm duration is equal to the average time of concentration of the studied watersheds. Time of concentration can be derived from existing studies or from web tools: eg. [Watershed Time of Concentration](https://www.lmnoeng.com/Hydrology/TimeConc.php). See Balbi et al. (2017) for a detailed description of these methods.

Hope this helps,  
James

---

<div class="post-metadata">

**Author:** ![r4mle](https://avatars.discourse-cdn.com/v4/letter/r/7bcc69/32.png) [@r4mle](https://community.naturalcapitalalliance.org/u/r4mle)\
**Post date:** [December 14, 2022, 8:01am UTC](https://community.naturalcapitalalliance.org/t/urban-flood-risk-mitigation-model-problem-in-soil-group-raster/3161/5 "2022-12-14T08:01:08Z")

</div>

Thank you for the information. It helped me a lot.

Another question is that, is that normal to the model that high runoff retention is low in flood volume and vice versa? How can I interpret this?

---

<div class="post-metadata">

**Author:** ![dave](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dave/32/70_2.png) [@dave](https://community.naturalcapitalalliance.org/u/dave)\
**Post date:** [December 15, 2022, 2:12pm UTC](https://community.naturalcapitalalliance.org/t/urban-flood-risk-mitigation-model-problem-in-soil-group-raster/3161/6 "2022-12-15T14:12:58Z")

</div>

> [@r4mle](#):
>
> Another question is that, is that normal to the model that high runoff retention is low in flood volume and vice versa?

Yes, runoff retention has an inverse relationship with flood volume (also referred to as runoff volume). The more runoff that is retained by vegetation or other landcover types, the less flooding will occur.

---

<div class="post-metadata">

**Author:** ![r4mle](https://avatars.discourse-cdn.com/v4/letter/r/7bcc69/32.png) [@r4mle](https://community.naturalcapitalalliance.org/u/r4mle)\
**Post date:** [December 15, 2022, 2:44pm UTC](https://community.naturalcapitalalliance.org/t/urban-flood-risk-mitigation-model-problem-in-soil-group-raster/3161/7 "2022-12-15T14:44:34Z")

</div>

Thank you so much! I was just confused by the flood volume. I thought it should be direct proportional. But anyways, thanks for the information!

---

<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:** [December 22, 2022, 2:45pm UTC](https://community.naturalcapitalalliance.org/t/urban-flood-risk-mitigation-model-problem-in-soil-group-raster/3161/8 "2022-12-22T14:45:11Z")

</div>

Closed on December 22, 2022, 2:45pm UTC

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