This forum is shutting down! Please post new discussions at

InVEST Carbon Model

sdattaraysdattaray Member

I am currently working with the InVEST Carbon Model (v. 3.3.3), and encountered an OverflowError, specifically "Python int too large to convert to C long". Attached is the log file. If there's more information I can provide, please let me know. 

Post edited by sdattaray on


  • RichRich Administrator, NatCap Staff
    Oh man what is this?  A nodata value that doesn't fit into an `int`?  It's a possibility.  Can you dropbox me your data to and I can take a look?
  • Sent the dropbox link.
  • RichRich Administrator, NatCap Staff
    Hi, your "nearest_to_edge_I.tif" raster file was missing a nodata value.  I added one and was able to run the model all the way through.  Here's a version of that file w/ a nodata file added for you:

  • Thank you! 

  • Follow up question: Previously you stated that the issue with the file was in the no data values in the future model raster. How do I edit the raster into a usable form?
  • RichRich Administrator, NatCap Staff
    Hi, if it's the same raster, I made one for you above (still available to download here

    I made it by effectively making a pass-through raster calculator call but setting a nodata value for the output.  There might be better ways to do it!
  • Okay, thank you! I'll be working with a bunch of the files so, I'll give it a try.
  • MariaMaria Member

    We have tried to use Invest but when running the model we have a lot of problems with the data. We are attaching you a txt file reporting the error.

    Our main goal is to estimate the value of carbon loss as a consequence of a wildfire. The current land use/land cover raster has been created through a shape file containing the land use. In addition, the future land use/land cover raster is a file with a value zero for each pixel. 

    We would like to know if the problem is related with the database or maybe our inexperience with the program.

    Many thanks in advance,

  • jdouglassjdouglass Administrator, NatCap Staff
    Hi @Maria,

    This error is saying that your current landcover raster ("raster_actual_1") has pixels with a value of 0, but that 0 is not defined in your biophysical table.

    If 0 is supposed to be a valid landcover code, then you'll need to add an entry to your biophysical table for the landcover code 0.

    If 0 is supposed to be the nodata value, please make sure that your landcover raster has its nodata value correctly set.

    Hope this helps!
  • MariaMaria Member

    Many many thanks. 
    Following your help we have addressed the problem. Nevertheless, we have new errors..
    A new txt is attached..

    Many thanks in advance!

  • jdouglassjdouglass Administrator, NatCap Staff
    @Maria, thanks for attaching the logfile.  Could you send your inputs to so I can take a look?

  • DaveDave Member, Administrator, NatCap Staff
    @Maria @jdouglass,

    Sorry I'm late to the party, but this is most likely an issue we've seen reported here before, where the input raster does not have a nodata value defined. So defining a nodata value for your lulc rasters will most likely solve this problem. And a future version of the model won't crash in this situation.

Sign In or Register to comment.