Carbon Model - ValueError; raster values do not have corresponding entries

Hello,

I am trying to run the carbon model and I continually have a value error even though the raster attribute table and carbon pools data correspond. output log and error message are attached.

Thanks for you help.

Comments

  • DaveDave Member, Administrator, NatCap Staff
    In general InVEST models are not reading raster attribute tables. They are only reading pixel values. So the message indicates that your raster has pixel values of 21, 30, and 50, but those codes are missing from the carbon pools table.

    If you're not seeing those codes in your raster attribute table, I can't explain that. Maybe you could try re-building the table, or use another GIS function to find all the unique values present in your raster.

    Anyway, the solution here is probably to reclassify those particular values to values that are already present in your carbon pools table, or to add new entries to the table for those values.

    Hope this helps,
  • Thanks, Dave. So those values 21, 30, and 50 are under the column "Value" in the raster attribute table and they have corresponding pixel values in the "Count" column. I tried reclassifying and changing these values, but it gives me the same error. (The value column is not removable and it must be numeric.) Also, I tried adding a column entitled values to the carbon pool table with those same values but that didn't work either...
  • swolnyswolny Member, NatCap Staff
    Do you also have the values 21, 30 and 50 in the "lucode" field in the carbon pools table? Every value in the land cover raster must have a corresponding row in the carbon pool table, even if those carbon pool values are all 0. Please see the Data Needs section of the User Guide for Carbon for details on the field name requirements.

    ~ Stacie

  • DaveDave Member, Administrator, NatCap Staff
    Remember that the model is not reading your raster attribute table at all, so modifying the contents of that table won't have an effect. When reclassifying raster values, try a tool called "reclassify" (or similar), rather than editing the attribute table. You need to actually modify pixel values, which editing the table won't do.
Sign In or Register to comment.