Hi,
I’m doing a carbon landuse change analysis for an assignment at university.
I am using carbon pool data from the Willamette.csv that comes with the sample data. I have run the sample data and they run fine.
Yet I’m unable to run my own tif’s that I generated for my study area. The moment things appear to go wrong in the model log is this:
Traceback (most recent call last):
File “pygeoprocessing\geoprocessing.py”, line 443, in raster_calculator
File “pygeoprocessing\geoprocessing.py”, line 1885, in _map_dataset_to_value_op
pygeoprocessing.geoprocessing.ReclassificationMissingValuesError: The following 1 raster values [0] from “C:/BaldeCarbon_3d/InVEST_files/TIFs/R_act.tif” do not have corresponding entries in the value map: {1: 0.019440000000000502, 2: 0.006480000000000166, 3: 0.0025920000000000665, 4: 0.0, 5: 0.012960000000000332, 6: 0.0, 7: 0.0, 8: 0.0, 9: 0.0, 10: 0.0, 11: 0.0, 16: 0.0, 18: 0.0, 19: 0.0, 20: 0.0, 21: 0.0, 24: 0.0, 29: 0.0, 32: 0.0, 33: 0.0, 39: 0.12960000000000332, 40: 0.0, 42: 0.0, 49: 0.1749600000000045, 51: 0.0972000000000025, 52: 0.11664000000000299, 53: 0.23328000000000598, 54: 0.25920000000000665, 55: 0.11664000000000299, 56: 0.012960000000000332, 57: 0.11404800000000294, 58: 0.2138400000000055, 59: 0.2916000000000075, 60: 0.38880000000001, 61: 0.4860000000000125, 62: 0.10368000000000266, 66: 0.0972000000000025, 67: 0.0012960000000000332, 68: 0.0025920000000000665, 71: 0.0038880000000000997, 72: 0.012960000000000332, 73: 0.010368000000000266, 74: 0.006480000000000166, 75: 0.006480000000000166, 76: 0.0025920000000000665, 77: 0.0025920000000000665, 78: 0.0025920000000000665, 79: 0.0038880000000000997, 80: 0.0012960000000000332, 81: 0.0, 82: 0.0038880000000000997, 83: 0.006480000000000166, 84: 0.006480000000000166, 85: 0.006480000000000166, 86: 0.007776000000000199, 87: 0.010368000000000266, 88: 0.0012960000000000332, 89: 0.012960000000000332, 90: 0.006480000000000166, 91: 0.0012960000000000332, 92: 0.16200000000000417, 93: 0.016848000000000436, 95: 0.35640000000000915, 98: 0.12960000000000332, 101: 0.009072000000000233, 102: 0.0}.
I’m very green with GIS but I’ve checked the attribute tables of the tif’s and there are no zero’s.
I can see this appears to be a python dictionary, where the keys are the lucode. I absolutely wonder what the values represent…
Any help greatly appreciated.
Thx
I have been able to run the model including a zero lucode category in the Willamette csv. What I observe in the model output (beside the fact that inside my study area carbon renderings are correct), is that the raster file is now a rectangle that includes my study area. I assume that for some reason the model is setting to zero all the Values inside this rectangle but outside my study area. This is not really so great bcs when I have a no change area in my study area, I won`t be able to distinguish it from the outside of the study area.
Hi @francisco ,
I’m glad you were able to run the model by adding a row to the attribute table! This is one of the classic way of handling this sort of mismatch, where there are pixel values of 0 somewhere in your raster that you weren’t expecting.
My guess is that your LULC raster doesn’t have a nodata value set, and that it should be set to 0. If this is correct, then I bet that’ll take care of the rectangle around your study area.
If that doesn’t end up being the case, could you provide your LULC so we can take a look?
Thanks,
James
Hi James,
Unfortunately your answer ended up in the junk folder, which I wasn’t expecting and I just found it there….
The problem of the zero values in the raster ended up completely going away after I, due to some modifications to the lucode defining vector files, used the polygon to raster geoprocessing tool (arcgis pro) to directly produce the tif files. Before, when the problem appeared I had done this in two steps, first use polygon to raster and then export raster to tiff.
Everyrthing went fine from there.
Thank you for taking the time to answer!
Francisco
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.