This forum is shutting down! Please post new discussions at community.naturalcapitalproject.org

RIOS Portfolio translator: OverflowError: Python int too large to convert to C long

jellisojelliso Member
edited December 2015 in RIOS
Hi all,

I've encountered a new error while trying to run RIOS Portfolio Translator: "OverflowError: Python int too large to convert to C long"

Another post found that a similar error was produced by too large rasters. However, this cannot be the case here since my rasters are quite small. I find it strange that I had no problem with RIOS Portfolio Advisor. I'll attach the log. 

I appreciate any help on this,
James
Post edited by jelliso on
Tagged:

Comments

  • RichRich Administrator, NatCap Staff
    Hi James, this sounds like a bug we might have fixed in the past.  Before we get into it just want to make sure you're updated to RIOS 1.1.14: http://data.naturalcapitalproject.org/rios_releases/rios_1.1.14_x86_setup.exe

    If you are at 1.1.14, can you Dropbox your data stack to richsharp@stanford.edu as well as the RIOS parameters file which can be generated from the File -> Save Parameters menu on the top of the RIOS application bar.
  • Thanks Rich for offering to look at my data. I sent you via Google Drive since my dropbox is full. I am indeed using RIOS 1.1.14.

    Also:
    - I am aiming at both erosion control and baseflow
    -my CRS is ESPG 32637 (WGS 84 UTM zone 37N)
    -Land uses 11 through 18 in the biophysical table do not appear in the LU map because these are "post-intervention" land use classes

    Feel free to contact me about anything. I will respond quickly!
    -james
  • Hi Rich, were you able to access the data on the google drive?
  • RichRich Administrator, NatCap Staff
    Sorry James, I was not.  Can you grant read permission to richpsharp@gmail.com?
  • Ooops... Ok, I think it should be good now...
  • RichRich Administrator, NatCap Staff
    Hi James, that overflow is occurring when PORTER writes the new transitioned landcover map type.  By default PORTER assumes the output type of the transitioned landcover maps are 32 bit signed ints which is normally fine, and it carries the user provided nodata value over to the new value which is also normally fine.  In your case the landcover map was an *unsigned* 32 bit int and the nodata value was 2^32 which overflows the max positive int by almost 2^31. :)

    I wrote a trivial patch for this that manually sets the PORTER output nodata types to -9999: https://bitbucket.org/natcap/rios/pull-requests/30/1115-hotfix/diff, but another engineer needs to code review it before we can do a release, and everyone is on vacation now.  If you want to skirt around the issue with data, you can change the type of your landcover map to a signed 32 bit int and set the nodata value to -1 or something reasonable.  Otherwise we'll get a patch released in early Jan.
  • RichRich Administrator, NatCap Staff
    Hi James, RIOS 1.1.15 should fix your issue: http://data.naturalcapitalproject.org/rios_releases/rios_1.1.15_x86_setup.exe

    And thanks @jdouglass for doing the pull request on the break!
  • Amazing! Thanks Rich and @jdouglass!
Sign In or Register to comment.