Hello,
i’m trying to run the Annual Water Yield Model at the moment. If I start it, it runs for a while and stops and gives the error: KeyError encountered: 0
I already looked through the forum and tried different strategies, like for example this one:
I also checked the CSV-table for blank lines.
But unfortunately nothing seemed to work so far. Is there anything else I can do?
Thanks for posting to the forums and welcome! Thanks for including the log file and doing some searching for possible solutions. This KeyError is a bit different than most we see and I have a hunch of what is causing it. Would you be willing to share your input data for the model with me via Google Drive, email ( ddenu @ stanford . edu ) or another cloud sharing option? It would help in debugging the issue.
Hi @Felix , I know Doug may be offline for a couple days so I took a look at your log and I think this may be a bug in the model. I’m able to reproduce this error whenever I use a geopackage instead of a shapefile for the watersheds layer. This is because shapefile FIDs are indexed starting from 0 and gpkg FIDs start from 1. And the model is trying to join stats indexed by the gpkg FIDs to an output layer shapefile.
Anyway, we’ll work on fixing this bug and in the meantime if you convert your watershed gpkg to a shapefile, the model should complete.