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

Problem in running SDR model in InVEST 3.5.0

mzabihi69mzabihi69 Member
edited November 2018 in Freshwater Models

Dear Sir/Madam,

I have a problem to run the
Sediment Delivery Ratio (SDR) model of InVEST 3.5.0. To execute of the
mentioned model,
I prepared all of the necessary inputs, but I am facing
with the following errors.

When the software is opened: C:\INVEST~2.0_X\INVEST~1\qtpy\__init__.py:181:
RuntimeWarning: Selected binding "pyqt5" could not be found, using
"pyqt4"

After clicking RUN: The rasters' and
vectors' intersection is empty (not all rasters and vectors touch each other).

The detailed information about the error is presented
below:

11/22/2018
08:05:47  natcap.invest.utils INFO     Writing log messages to C:\Users\Mohsen
Zb\Desktop\New folder
(2)\InVEST-Sediment-Delivery-Ratio-Model-(SDR)-log-2018-11-22--08_05_47.txt

11/22/2018
08:05:47  natcap.invest.ui.model Level
100 Starting model with parameters:

Arguments
for InVEST natcap.invest.sdr 3.5.0:

biophysical_table_path      E:/PhD/Thesis/Modeling/ES
Modeling/Run/1_Inputs/Biophysical_T_SDR_93.csv

dem_path                    E:/PhD/Thesis/Modeling/ES Modeling/Run/1_Inputs/dem30_talar.tif.ovr

drainage_path              

erodibility_path            E:/PhD/Thesis/Modeling/ES
Modeling/Run/1_Inputs/kfactor.ovr

erosivity_path              E:/PhD/Thesis/Modeling/ES
Modeling/Run/1_Inputs/rfactor1393.tif.ovr

ic_0_param                  10

k_param                     2

lulc_path                   E:/PhD/Thesis/Modeling/ES
Modeling/Run/1_Inputs/lu1393.ovr

results_suffix             

sdr_max                     0.8

threshold_flow_accumulation
1000

watersheds_path             E:/PhD/Thesis/Modeling/ES
Modeling/Run/1_Inputs/Watershed_Talar.shp

workspace_dir               C:\Users\Mohsen Zb\Desktop\New
folder (2)

 

11/22/2018
08:05:47  natcap.invest.ui.model
ERROR    Exception while executing
<function execute at 0x11CF7F70>

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\model.py",
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\sdr.py",
line 163, in execute

  File
"C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\env\lib\site-packages\pygeoprocessing\geoprocessing.py",
line 606, in align_and_resize_raster_stack

ValueError:
The rasters' and vectors' intersection is empty (not all rasters and vectors
touch each other).

11/22/2018
08:05:47  natcap.invest.ui.model
INFO     Execution finished

11/22/2018
08:05:47  natcap.invest.utils INFO     Elapsed time: 0.05s

 

I checked all the vector and rater maps to be completely
covered by each other and there were no any differences between the boundaries.
Could anyone help me to solve the mentioned errors and run the SDR model of
InVEST 3.5.0 ?

 

Thank you in advance

Looking forward to hear
from you

Best  

Post edited by mzabihi69 on

Comments

  • swolnyswolny Member, NatCap Staff
    Hello @mzabihi69 -

    Thank you for posting the log file.

    Did you verify that all of your inputs have the same projected coordinate system? This error often means that at least one of them is in a different coordinate system. Another possibility is that one of your sub-watersheds (if you are using multiple polygons and not just one in Watershed_Talar.shp) is outside of the boundary of your raster inputs - it may be a very small watershed that's hard to see.

    Also, I see that you are using as raster inputs .ovr files, try using the .tif files (not .tif.ovr, just .tif) and see if that makes a difference.

    ~ Stacie
  • mzabihi69mzabihi69 Member
    edited November 2018

    Dear Stacie (@swolny)

     

    Thank you for useful response and
    help.

    Although I was prepared the inputs,
    but I had a double check for possible errors in the input preparation process.
    As you mentioned in the answer, my watershed boundary was outside (it was very
    small) of the raster inputs. Fortunately, the SDR model was ran successfully.

     Once again, I appreciate you
    for your support.

     

    Kindly,

    Mohsen 

    Post edited by mzabihi69 on
  • mzabihi69mzabihi69 Member
    edited November 2018

    Dear @swolny

     

    Thank you for useful response and help.

    Although I was prepared the inputs, but I had a double check for possible errors in the input preparation process.
    As you mentioned in the answer, my watershed boundary was outside (it was very small) of the raster inputs. Fortunately, the SDR model was ran successfully.

    Once again, I appreciate you for your support.

     

    Kindly,

    Mohsen 

    Post edited by mzabihi69 on
  • swolnyswolny Member, NatCap Staff
    I'm glad to hear that it ran successfully, Mohsen, thank you for the update.

    ~ Stacie

  • adrianvogladrianvogl Member, NatCap Staff
    Hi folks,
    I also ran into a strange error when running SDR. My parameter and data package are at this link, and the log file is attached. Any guidance would be appreciated!

    Cheers,
    Adrian
  • RichRich Administrator, NatCap Staff
    Hi @adrianvogl, these lines in your log are concerning:

    12/16/2018 19:29:39  osgeo              ERROR    [errno 1] LZWDecode:Corrupted LZW table at scanline 11776
    12/16/2018 19:29:39  osgeo              ERROR    [errno 1] TIFFReadEncodedTile() failed.
    12/16/2018 19:29:39  osgeo              ERROR    [errno 1] C:\InVEST_workspace_Brazil\intermediate_outputs\flow_accumulation_base90m2.tif, band 1: IReadBlock failed at X offset 46, Y offset 69
    12/16/2018 19:29:39  osgeo              ERROR    [errno 1] GetBlockRef failed at X block offset 46, Y block offset 69

    We see this when disk space fills up and recently I've been seeing a LZWDecode error that I cannot explain when I'm doing global runs on tens of thousands of rasters. Almost like there's a GeoTIFF LZW bug. I'm running your data on the development version of SDR and noticing these intermediate rasters are ~200-400MB. I'm expecting a total disk footprint of several gigabytes for your SDR run. So:

    1) check to make sure you have a healthy amount of disk space left, and
    2) Try your analysis on our development version of SDR that'll run faster and give better results anyway: http://data.naturalcapitalproject.org/nightly-build/invest-forks/richsharp/InVEST_3.5.0.post712+ha802ecd972dc_x86_Setup.exe
  • RichRich Administrator, NatCap Staff
    Hey @adrianvogl, I'm getting the same LZWEncode error. This is really a deep problem in something we don't have control over in our library. I think we're going to have to change something for the next version of InVEST. I'll post back here when we have an alternative.
  • RichRich Administrator, NatCap Staff
    Hi @adrianvogl, here's a build of InVEST that patches that LZWEncode error that you can run on your end: http://data.naturalcapitalproject.org/nightly-build/invest-forks/richsharp/InVEST_3.5.0.post715+hca26691b81f8_x86_Setup.exe

    Keep in mind you have a HUGE dataset, so almost all the operations will take a while to execute, but I think it'll get you all the way there this time.
  • adrianvogladrianvogl Member, NatCap Staff
    Hi @Rich, thanks for the new version. Sorry for the late reply but I wanted to let you know that it finally worked for me all the way through! Thanks a lot for the quick action on this bug.

This discussion has been closed.