Carbon Model error Value_map

Hello guys,

I tried to run the Carbon model but I had this problem during the process. I guess there is something about the LULC raster, but I didn’t understand what the problem and how to solve it. If you guys have any idea I appreciate…

The main error says: The following 10 raster values …do not have corresponding entries in the value_map

InVEST-InVEST-Carbon-Model-log-2019-12-10–17_25_43.txt (4.3 KB)

The value_map in this case refers to the carbon pools CSV input, and the lucode column. Please modify either the LULC raster or the CSV to make sure all the unique raster values have rows in CSV.

1 Like

Hello sir,
I encountered with the same problem. I have 71 raster values which do not have corresponding values.Actually, I have a colored physical map of Goa (with no pixel values available) dividing the land cover into 24 categories; so accordingly, I gave the code to the 24 categories and some values for its carbon pool. When checked for attributes in QGIS, I found there are 3,33,171 features in the map. I don’t know how to give unique values to the raster and make it even with the rows in CSV. As I don’t have pixels for it, how should I proceed to overcome the problem?
InVEST-InVEST-Carbon-Model-log-2020-01-22–15_23_16.txt (5.4 KB)

Hello @pravinyab -

Assuming that the land cover map is a raster, each of the 333,171 grid cells will have a value assigned, based on the 24 categories. Usually, land cover maps have an integer value assigned to each grid cell, so, for example, if you have 24 land use classes, they will correspond to integer values 1-24, where, say, “urban” areas have a value of 1, “agriculture” a value of 2, etc.

One very big problem with QGIS is that it does not allow you to see the raster attribute table, which would directly show you these integer values (and perhaps the class name, if the raster has them.) But if you use the GIS information tool and click around, you should see that each grid cell has a particular numeric value. The land cover map should have come with documentation showing which integer value corresponds with which land cover type (like 1=urban, 2=agriculture…) You can use this information to create the carbon pool table, providing these integer values in the “lucode” field. So you only need to create carbon pool data for 24 classes, not 333,171. The model requires that all values in the land cover map have “lucode” values in the carbon pool table.

~ Stacie

1 Like

From the log, the 71 raster values that are missing all have values from 0 - 255. That fact, combined with your statement, makes me wonder, does your raster actually just have RGB (red-green-blue) values? In which case, does it actually have 3 bands? If so, probably only the 1st band is being opened by the model. And the pixel values represent shades of red rather than landcover categories.

The model wants to get a raster with a single band, and with pixel values as described by Stacie. It might be challenging, but not impossible, to reclassify your “colored map” to a proper landcover raster. A better option though might be search for alternative data sources for the land cover raster?

But sir the problem is that when used the information tool I got integers ranging from 1 to 255 repeating multiple times. Here, I lost how to connect the 24 classes with the integers and the features.

Sir, the raster have 4 bands (Red-Green-Blue-Alpha). So how do I proceed in such case?

I have never had to deal with that before, but I think you’d need to know which combinations of RGB are associated with different land cover types, and do that combination/mapping into a single band raster somehow. Honestly, I’d look for a different land cover source where you only have one band, which contains the numeric land cover code, and provides a listing of which code corresponds with which land cover type.

~ Stacie

Yes, completely agree with Stacie.

Here’s another post about a similar problem with possible solutions. None of them sound easy.

Okay Sir. I will try finding another source itself. The other I have also has 3 bands. Will see how to proceed. Thanks a lot.