error :/

Hy everybody, I try to run InVEST and the software show me this eror: " there was not a value for at least the following codes [0. 13.] for this file c:/blabla/ temp/ tmpqdt6ih. Nodata Value is : -9999.0 . 
Did someone have a idear about what to do?

Comments

  • swolnyswolny Member, NatCap Staff
    Hi @greygoose -

    It's useful if you post your whole log file, so we can see which version of InVEST you're using and exactly where the error is happening. 

    Usually, that error happens when there are values in your LULC raster that do not have corresponding entries in the biophysical table. Check to see if that's the case, and if that's not the problem, please post the log file - thanks.

    ~ Stacie
  • Hey! Thank for your help :). 
    InVEST just write me this message:

    Initializing...

    Showing messages with level INFO and higher

    06/12/2018 17:33:39 natcap.invest.utils INFO Writing log messages to C:\Users\Grégoire\Documents\hydropower_water_yield_workspace\InVEST-Hydropower-Water-Yield-log-2018-06-12--17_33_39.txt

    06/12/2018 17:33:39 natcap.invest.ui.usage ERROR Error when transforming coordinates: local variable 'spatial_ref' referenced before assignment

    Traceback (most recent call last):

    File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\ui\usage.py", line 176, in _merge_local_bounding_boxes

    UnboundLocalError: local variable 'spatial_ref' referenced before assignment

    06/12/2018 17:33:39 natcap.invest.ui.model Level 100 Starting model with parameters:

    Arguments for InVEST natcap.invest.hydropower.hydropower_water_yield 3.4.2.post79+nd6763695fe3d:

    biophysical_table_uri C:/Users/Grégoire/Desktop/biophysical_table.csv

    calculate_valuation True

    calculate_water_scarcity True

    demand_table_uri C:/Users/Grégoire/Desktop/water_demand_table.csv

    depth_to_root_rest_layer_uri C:/Users/Grégoire/Desktop/stage toulouse/FSI_Territoire_de_Carto-campus/utile/DEPTHROOTS.tif

    eto_uri C:/Users/Grégoire/Desktop/stage toulouse/FSI_Territoire_de_Carto-campus/utile/EVAP.tif

    lulc_uri C:/Users/Grégoire/Desktop/stage toulouse/FSI_Territoire_de_Carto-campus/utile/lulc.tif

    pawc_uri C:/Users/Grégoire/Desktop/stage toulouse/FSI_Territoire_de_Carto-campus/utile/WATERAI.tif

    precipitation_uri C:/Users/Grégoire/Desktop/stage toulouse/FSI_Territoire_de_Carto-campus/utile/PRECIP.tif

    results_suffix

    seasonality_constant 20

    sub_watersheds_uri C:/Users/Grégoire/Desktop/stage toulouse/FSI_Territoire_de_Carto-campus/Contour_campus_STI.shp

    valuation_table_uri C:/Users/Grégoire/Desktop/hydropower_valuation_table.csv

    watersheds_uri C:/Users/Grégoire/Desktop/stage toulouse/FSI_Territoire_de_Carto-campus/Contour_campus_STI.shp

    workspace_dir C:\Users\Grégoire\Documents\hydropower_water_yield_workspace


    06/12/2018 17:33:39 natcap.invest.ui.usage ERROR Error when transforming coordinates: local variable 'spatial_ref' referenced before assignment

    Traceback (most recent call last):

    File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\ui\usage.py", line 176, in _merge_local_bounding_boxes

    UnboundLocalError: local variable 'spatial_ref' referenced before assignment

    06/12/2018 17:33:39 natcap.invest.hydropower.hydropower_water_yield INFO Starting Water Yield Core Calculations

    06/12/2018 17:33:39 natcap.invest.ui.usage ERROR Error when transforming coordinates: local variable 'spatial_ref' referenced before assignment

    Traceback (most recent call last):

    File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\ui\usage.py", line 176, in _merge_local_bounding_boxes

    UnboundLocalError: local variable 'spatial_ref' referenced before assignment

    06/12/2018 17:33:39 natcap.invest.ui.usage ERROR Error when transforming coordinates: local variable 'spatial_ref' referenced before assignment

    Traceback (most recent call last):

    File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\ui\usage.py", line 176, in _merge_local_bounding_boxes

    UnboundLocalError: local variable 'spatial_ref' referenced before assignment

    06/12/2018 17:33:39 natcap.invest.ui.usage ERROR Error when transforming coordinates: local variable 'spatial_ref' referenced before assignment

    Traceback (most recent call last):

    File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\ui\usage.py", line 176, in _merge_local_bounding_boxes

    UnboundLocalError: local variable 'spatial_ref' referenced before assignment

    06/12/2018 17:33:39 natcap.invest.ui.usage ERROR Error when transforming coordinates: local variable 'spatial_ref' referenced before assignment

    Traceback (most recent call last):

    File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\ui\usage.py", line 176, in _merge_local_bounding_boxes

    UnboundLocalError: local variable 'spatial_ref' referenced before assignment

    06/12/2018 17:33:39 natcap.invest.pygeoprocessing_0_3_3.geoprocessing WARNING

    Items are not equal to 7 significant digits:

    ACTUAL: 1.1962678264677524

    DESIRED: 1.72365313148126

    06/12/2018 17:33:39 natcap.invest.ui.usage ERROR Error when transforming coordinates: local variable 'spatial_ref' referenced before assignment

    Traceback (most recent call last):

    File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\ui\usage.py", line 176, in _merge_local_bounding_boxes

    UnboundLocalError: local variable 'spatial_ref' referenced before assignment

    06/12/2018 17:33:39 natcap.invest.pygeoprocessing_0_3_3.geoprocessing WARNING

    Items are not equal to 7 significant digits:

    ACTUAL: 1.1962678264677524

    DESIRED: 1.72365313148126

    06/12/2018 17:33:39 natcap.invest.ui.usage ERROR Error when transforming coordinates: local variable 'spatial_ref' referenced before assignment

    Traceback (most recent call last):

    File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\ui\usage.py", line 176, in _merge_local_bounding_boxes

    UnboundLocalError: local variable 'spatial_ref' referenced before assignment

    06/12/2018 17:33:39 natcap.invest.ui.usage._log_model WARNING an exception encountered when logging UnicodeDecodeError('utf8', 'C:\\Users\\Gr\xe9goire', 11, 12, 'invalid continuation byte')

    06/12/2018 17:33:40 natcap.invest.hydropower.hydropower_water_yield INFO Reclassifying temp_Kc raster

    06/12/2018 17:33:40 natcap.invest.ui.model ERROR Exception while executing <function execute at 0x12D10DF0>

    Traceback (most recent call last):

    File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\ui\model.py", line 1505, in _logged_target

    File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\hydropower\hydropower_water_yield.py", line 195, in execute

    File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\pygeoprocessing_0_3_3\geoprocessing.py", line 1598, in reclassify_dataset_uri

    File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\pygeoprocessing_0_3_3\geoprocessing.py", line 2385, in vectorize_datasets

    File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\pygeoprocessing_0_3_3\geoprocessing.py", line 1588, in map_dataset_to_value

    ValueError: There was not a value for at least the following codes [ 0.] for this file c:\users\grgoir~2\appdata\local\temp\tmp3yky8s.

    Nodata value is: -9999.0

    06/12/2018 17:33:40 natcap.invest.ui.model INFO Execution finished

    06/12/2018 17:33:40 natcap.invest.utils INFO Elapsed time: 1.54s

    06/12/2018 17:33:40 natcap.invest.ui.execution ERROR Target <function _logged_target at 0x044A4F30> failed with exception

    Traceback (most recent call last):

    File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\ui\execution.py", line 68, in run

    File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\ui\model.py", line 1505, in _logged_target

    File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\hydropower\hydropower_water_yield.py", line 195, in execute

    File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\pygeoprocessing_0_3_3\geoprocessing.py", line 1598, in reclassify_dataset_uri

    File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\pygeoprocessing_0_3_3\geoprocessing.py", line 2385, in vectorize_datasets

    File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\pygeoprocessing_0_3_3\geoprocessing.py", line 1588, in map_dataset_to_value

    ValueError: There was not a value for at least the following codes [ 0.] for this file c:\users\grgoir~2\appdata\local\temp\tmp3yky8s.

    Nodata value is: -9999.0

    06/12/2018 17:33:40 natcap.invest.ui.execution INFO Execution finished06/12/2018 17:33:48 natcap.invest.ui.inputs INFO Opening file explorer to workspace directory

    06/12/2018 17:33:48 natcap.invest.ui.inputs INFO Using windows explorer to view files

    06/12/2018 17:33:49 natcap.invest.ui.inputs INFO Opening file explorer to workspace directory

    06/12/2018 17:33:49 natcap.invest.ui.inputs INFO Using windows explorer to view files

    06/12/2018 17:33:50 natcap.invest.ui.inputs INFO Opening file explorer to workspace directory

    06/12/2018 17:33:50 natcap.invest.ui.inputs INFO Using windows explorer to view files


     I don't know what to do :). Could you please send me the differents CSV file that you use ? 


  • swolnyswolny Member, NatCap Staff
    Thanks for sending the logging information. It looks like the error might be related to the Kc field in your biophysical table. Do you have a value of 0 in your land use raster that does not have a corresponding Kc value in your biophysical table? 

    Another thing to try is using the latest version of InVEST (3.4.4), since the software developers make bug fixes regularly.

    Look at both of these things and let us know how it goes.

    ~ Stacie
Sign In or Register to comment.