This forum is shutting down! Please post new discussions at

SWY - KeyError '10': Watershed error ?

My InVEST SWY model runs well but stops at some point, after it has created almost all outputs : monthly rasters (all but the 12th), quickflow, etc.
The error message is : "KeyError encountered : 10". I checked the "aggregated_results" vector : from the 10th subwatershed there was no value computed, so I guess the error is linked to this watersheds vector in some way.
Does anybody know what happens ? And do you think I can still use the produced rasters, or could they be incomplete ?
Thanks a lot !

Here are my run's log.


  • swolnyswolny Member, NatCap Staff
    Hm, the log isn't helping much this time, and I'm not sure what would be wrong with the 10th subwatershed in particular, unless perhaps it is outside of the area covered by the rest of your input data? 

    It's also strange that the 12th monthly quickflow raster wouldn't be created - I assume that you have provided precipitation and ET0 data for all 12 months, yes? Since this output is missing, I wouldn't use the produced rasters. Theoretically, if the model has gotten to the point of aggregating to the watershed, it should be finished with the main calculations, but I wouldn't trust it until we make sure that it is producing all of the proper outputs.

    I know that the SWY data can be large, but is it possible for you to upload it somewhere so I can troubleshoot?

    ~ Stacie
  • Thank you already for this comment. The 10th subwatershed was kind of out of the area indeed (too small actually)...
    And after taking this very watershed out of the shapefile, it ran perfectly !
  • swolnyswolny Member, NatCap Staff
    Glad to hear it! 

    Then I'll mark this as Resolved.

    ~ Stacie
This discussion has been closed.