This forum is shutting down! Please post new discussions at

SDR error

I have an error in SDR model, please help me

Here's the log


  • CatservantCatservant Member
    edited September 2018
    Oh, I'm sorry for missing infos. I'm researching DMZ in Korean peninsula with Invest. 

    facing with KeyError encountered : 1 and im using Invest ver 3.4.4

    plz help me get thru
    Post edited by Catservant on
  • swolnyswolny Member, NatCap Staff
    Hi @Catservant -

    Have you searched the forum for "KeyError"? There are lots of posts already about possible causes. Check them out and if they don't help, let us know.

    ~ Stacie
  • Hello @swolny 
    Thank you for your respond!

    I've tried hard to figure out what does KeyError 1 mean and troubleshoot but these are all I got:

    1. biophysical table are inconsistent with LULC 
    2. raster data is a bit smaller than watershed polygon that some parts are sticking out 

    So I made my raster data to entirely cover watershed polygon but also KeyError 1 popped out again.
    And biophysical table also matches  LULC data that I have.

    The weird thing is that when I compared my outcome log with other users', there were so many "no flow direction found for 0" phrases. Can't understand why..

    I will attach the latest log file so please take a look :)

  • swolnyswolny Member, NatCap Staff
    Do you get a stream.tif output from the model? If so, you can look at it to make sure that the model is generating a good stream network that is continuous. If it shows streams that are all chopped up, you might still need to do more filling of your DEM, and that might be the cause of the flow direction errors. I have gotten those same errors and still had good results though, so they're not necessarily something to worry about, if the stream network looks good, and you get reasonable values in the results (which I know you don't have yet.) 

    Do you only have one watershed, with ws_id = 1? Is that the one that you made the raster data to entirely cover?

    ~ Stacie
  • Hello there again @swolny

    First of all, I found that streams in stream.tif look good so I don't have to worry about it. Thanks.
    But weird thing is that stream.tif is located a bit lower than the watershed data when I open them in ArcMap.
    (They have same projection)
    I'll attach captured image. 
    Is there a possibility that there would be a problem in my flow accumulation value?

    And the watershed map that I have is comprised of ten polygons. Every raster data covers entire watershed.
    I double checked that the polygon part that has ws_id=1 is well covered.
    I honestly don't know what to do. Could you please help me figure out what to do? 

    Thanks a lot

    1282 x 692 - 96K
  • 09/20/2018 14:08:59 osgeo WARNING [errno 1] One or several characters couldn't be converted correctly from UTF-8 to ISO-8859-1. This warning will not be emitted anymore.

    09/20/2018 14:08:59 natcap.invest.ui.model ERROR Exception while executing <function execute at 0x115C1F70>

    Traceback (most recent call last):

    File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\env\lib\site-packages\natcap\invest\ui\", line 1541, in _logged_target

    File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\env\lib\site-packages\natcap\invest\", line 302, in execute

    File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\env\lib\site-packages\natcap\invest\", line 926, in _generate_report

    Extracted from the latest log. Maybe this could be a clue?

  • swolnyswolny Member, NatCap Staff
    I don't think that the warning about the characters is the issue. But it is interesting that the output doesn't overlap with your watersheds, that's probably the issue. So you're sure that all of your inputs are in the same projected coordinate system (not just assigned with SetProjection, but actually Reprojected)? ArcGIS will do on-the-fly reprojection to try and make things look like they line up, even if they really don't, so it can be confusing if you're trying to troubleshoot overlap problems.

    Which coordinate system? Another option is that it could be one that isn't supported by the software libraries. They do support a lot, but if in doubt, UTM is a safe bet.

    ~ Stacie

  • I used 'define projection', 'project raster' and 'project' tool for my raster data.
    I believe those are reprojecting tool but if they aren't please let me know.

    And I had no idea that I have to use the ones that are supported by the software libraries!
    I used Korea 2000 Korea Central Belt 2010 and maybe this is the very thing that caused us trouble.
    I'm going to try reprojecting to UTM. If there's no progress I'll let you know.

    Thanks a lot! 
  • hello again swolny
    Guess what! Once I changed the coordinate system into UTM, program worked out perfectly.
    I really appreciate your help.

    Thank you! 

  • swolnyswolny Member, NatCap Staff
    Great! Glad to hear it.

    ~ Stacie
Sign In or Register to comment.