InVEST 3.7 and 3.3.3 NDR error

Hi everyone,

I have tried to simulate the NDR model and I got the weird error as the following log in the attached file.

If there any one can help with this?

Best regards,
PheaktraInVEST_Nutrient_Delivery_Ratio_Model.txt (3.7 KB)

Thanks for the report, @Pheaktra. If you can share your input data I will try to reproduce this error.

Okay @Pheaktra, the problem here is that the landuse raster has a category (202) that does not appear in your biophysical table. If I add another line to that table with 202 in the lucode column, I get past this KeyError. A future version of InVEST will have an even more informative error message in this case.

Dear Dave,

Thank you so much. The problem has been solved.

Is there the same equation using for V.3.3.3 and V.3.7?

Thank you so much again, Dave.

Best regards,
Pheaktra

Hi Pheaktra, Dave,

I’ve run into a similar problem, but with the error message: “KeyError encountered: lucode 0 is present in the land use raster but not the biophysical table”.

I’ve looked through my land use raster, and I can’t find any NoData values, and there is no lucode = 0. I do have Background data with a pixel value of 1 that I’ve assigned as lucode =1. The model will run without errors when I edit the biophysical table by adding a new LULC type with lucode = 0 and values of 0 for load_n and eff_n. Is this a viable workaround to the error? I’ve attached my log file. Thank you!

InVEST-Nutrient-Delivery-Ratio-Model-(NDR)-log-2021-11-24–14_59_53.txt (11.2 KB)