Hello, this error is appearing when I run the urban flood risk model: ValueError: The biophysical table is missing a row for lucode(s) [255].
There are 0 values in the table, but they are meant as values and not meant as NoData. I tried adding a row for lucode 0 with CN values 0, and it still doesn’t work. Any thoughts? I attached the LULC raster and biophysical table. Thanks
Hi @EAM07 , thanks for creating a new topic. Your message says “biophysical table is missing a row for lucode(s) [255]”.
You need a row in your table for code 255. Or you you need to reclassify the 255 in your raster to another code, or to nodata.
However, looking at your raster, I think you might need to go back a few steps to the original source of the landcover raster. The raster you linked here is a simple image, with Red-Green-Blue bands. The pixel values only represent colors on the RGB scale.
What you really need is a raster with the pixel values representing categories of landcover, to match your biophysical table. If you did any pre-processing to create this raster, you might want to go back to the original source. Or if this is the original data source, you might need to find a different source for the LULC raster.
Hello again,
Thank you for your response.
Actually the is no lucode 255, so the error is really weird.
I did however check the LULC raster, and I fixed the issue, my rasters both include pixel values and I relaunched the model, I am now getting this error, although I added a row for lucode 0 with 0 values:
ValueError: The biophysical table is missing a row for lucode(s) [0]
Hi @EAM07 , thanks for updating your data. Could you please share the rest of your input data (Area Of Interest & soils raster) and the logfile in your output workspace? Thank you,
Did you know your raster has 3 layers? This could be an issue.
Moreover, when I open it either on QGIS or R, I get an image as if it was a map image (with a north arrow and all) not an actual raster. Maybe that’s the problem?
Thanks for these items. There’s a couple things going on here, including a misleading error message since you do have “0” present in the biophysical table.
But, looking at the updated landcover raster, it seems likely that “0” is intended to represent nodata, rather than a particular landcover type. All the green around the outside of this raster has a value 0.
I tried everything you suggested and then I got this error:
ValueError: invalid entry in choice array
Check that the Soil Group raster does not contain values other than (1, 2, 3, 4)
I think the problem was the hydrologic soil group raster because it has more than 4 values. However I downloaded the map that is suggested in the documentation of the model, I couldn’t find any other hydrologic soil group maps. I attached the 2 files I’m trying to use for you to check, but I think maybe this is the main issue?
Yes, the soil raster is now the problem. Often solving one problem reveals another. Which soils dataset did you download? There are a couple mentioned in the documentation and it is also mentioned that these rasters need to be reclassified to only contain values from 1 - 4 before using them. That seems like the step you will need to take.
Since the last time I tried to run the Urban Flood Risk Mitigation model without success, I decided to work on a smaller area so I changed all the data and ran the model again. This time I got this error ValueError: The biophysical table is missing a row for lucode(s) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]. I know the problem should be in the biophysical table because I think the other data is fine. I tried to inlude a row with 0 values, it still didn’t work. And the lucodes 0 to 11 don’t even exist in the table.
I uploaded all my layers in case you find something wrong…
I cleaned the biophysical table and I added a row for null values, and I’m still getting the same error… I attached the new biophysical table. BiophysicalTable_Carros.csv (223.5 KB)
Thanks for posting your data. LULC_Test2.tif has values of 0-11. But the biophysical table has lucodes that do not match these, they are values like 221205. As the User Guide specifies, the values in the “lucode” column in the biophysical table must match the values in your LULC raster exactly.