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

ERRO sdr

MARIANERMARIANER Member
edited August 2018 in General

Boa noite!

O que estou tentando executar é SDR, mas deu esse erro para uma tabela de atributos de acordo com o raster.

Já tentei executar várias vezes e sempre aparecer erro com uma tabela de atributos já existente várias vezes.

 

Initializing...

Showing messages with level INFO and higher

08/14/2018 20:21:13 natcap.invest.utils INFO Writing log messages to D:\MESTRADO\dinamica\SDR_WOKSPACE\InVEST-Sediment-Delivery-Ratio-Model-(SDR)-log-2018-08-14--20_21_13.txt

08/14/2018 20:21:14 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

08/14/2018 20:21:13 natcap.invest.ui.model Level 100 Starting model with parameters:

Arguments for InVEST natcap.invest.sdr 3.4.4:

biophysical_table_path D:/MESTRADO/dinamica/biophysical_table2.csv

dem_path D:/MESTRADO/dinamica/SRTM FILL/bacia_srtm_fill.tif

drainage_path

erodibility_path D:/MESTRADO/dinamica/K/RASTER_fator_K_JL_7classes_4m_cellsize/Solo_JL_7classes_4mcell.tif

erosivity_path D:/MESTRADO/dinamica/R/Raster_fator_R_83a01s92_4mcellsize/Fator_R_83a01s92_4mcellsize.tif

ic_0_param 0.5

k_param 2

lulc_path D:/MESTRADO/dinamica/raste/RASTER PROJETADO/Extract_Project.tif

results_suffix

sdr_max 0.8

threshold_flow_accumulation 5000

watersheds_path D:/MESTRADO/Dados calibrados/bacia shp/baciaJL.shp

workspace_dir D:\MESTRADO\dinamica\SDR_WOKSPACE


08/14/2018 20:21:15 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

08/14/2018 20:21:15 natcap.invest.utils WARNING There are empty strings in the header row at D:/MESTRADO/dinamica/biophysical_table2.csv

08/14/2018 20:21:15 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

08/14/2018 20:21:15 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

08/14/2018 20:21:15 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

08/14/2018 20:21:15 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

08/14/2018 20:21:15 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

08/14/2018 20:21:22 pygeoprocessing.geoprocessing INFO ReprojectImage 88.0% complete D:\MESTRADO\dinamica\SDR_WOKSPACE\aligned_erosivity.tif, psz_message ''

08/14/2018 20:21:22 pygeoprocessing.geoprocessing INFO ReprojectImage 100.0% complete D:\MESTRADO\dinamica\SDR_WOKSPACE\aligned_erosivity.tif, psz_message ''

08/14/2018 20:21:22 pygeoprocessing.geoprocessing INFO align_dataset_list aligning dataset 3 of 4

08/14/2018 20:21:31 pygeoprocessing.geoprocessing INFO ReprojectImage 32.0% complete D:\MESTRADO\dinamica\SDR_WOKSPACE\aligned_erodibility.tif, psz_message ''

08/14/2018 20:21:37 pygeoprocessing.geoprocessing INFO ReprojectImage 63.0% complete D:\MESTRADO\dinamica\SDR_WOKSPACE\aligned_erodibility.tif, psz_message ''

08/14/2018 20:21:43 pygeoprocessing.geoprocessing INFO ReprojectImage 94.0% complete D:\MESTRADO\dinamica\SDR_WOKSPACE\aligned_erodibility.tif, psz_message ''

08/14/2018 20:21:43 pygeoprocessing.geoprocessing INFO ReprojectImage 100.0% complete D:\MESTRADO\dinamica\SDR_WOKSPACE\aligned_erodibility.tif, psz_message ''

08/14/2018 20:21:43 natcap.invest.sdr INFO calculating slope

08/14/2018 20:21:44 natcap.invest.sdr INFO calculating flow direction

08/14/2018 20:21:47 natcap.invest.pygeoprocessing_0_3_3.routing.routing_core INFO labeling flats

08/14/2018 20:21:47 natcap.invest.pygeoprocessing_0_3_3.routing.routing_core INFO draining away from higher

08/14/2018 20:21:47 natcap.invest.pygeoprocessing_0_3_3.routing.routing_core INFO draining towards lower

08/14/2018 20:21:49 natcap.invest.pygeoprocessing_0_3_3.routing.routing_core INFO labeling flats

08/14/2018 20:21:50 natcap.invest.pygeoprocessing_0_3_3.routing.routing_core INFO draining away from higher

08/14/2018 20:21:50 natcap.invest.pygeoprocessing_0_3_3.routing.routing_core INFO draining towards lower

08/14/2018 20:21:50 natcap.invest.pygeoprocessing_0_3_3.routing INFO flats exist on second pass, must be flat areas that abut the raster edge

08/14/2018 20:21:50 natcap.invest.sdr INFO calculating flow accumulation

08/14/2018 20:21:54 natcap.invest.pygeoprocessing_0_3_3.routing.routing_core WARNING no flow direction found for 0 1

08/14/2018 20:21:54 natcap.invest.pygeoprocessing_0_3_3.routing.routing_core WARNING no flow direction found for 0 1

08/14/2018 20:21:57 natcap.invest.sdr INFO calculate ls term

08/14/2018 20:21:57 natcap.invest.sdr INFO classifying streams from flow accumulation raster

08/14/2018 20:21:58 natcap.invest.sdr INFO calculate per pixel W

08/14/2018 20:21:58 natcap.invest.ui.model ERROR Exception while executing <function execute at 0x10C92B30>

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

File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\sdr.py", line 554, in _calculate_w

File "site-packages\pygeoprocessing\geoprocessing.py", line 1207, in reclassify_raster

File "site-packages\pygeoprocessing\geoprocessing.py", line 198, in raster_calculator

File "site-packages\pygeoprocessing\geoprocessing.py", line 1201, in _map_dataset_to_value_op

ValueError: The following 1 raster values [0] from "D:\MESTRADO\dinamica\SDR_WOKSPACE\aligned_lulc.tif" do not have corresponding entries in the `value_map`: {2.0: 0.0, 3.0: 0.01, 4.0: 0.01, 5.0: 0.0005, 6.0: 0.0005, 7.0: 0.0001, 8.0: 0.0001, 9.0: 0.02, 11.0: 0.1, 12.0: 0.1, 13.0: 0.1, 15.0: 0.1, 18.0: 0.02, 19.0: 0.02, 20.0: 0.02, 21.0: 0.1, 22.0: 0.02, 30.0: 0.0001}

08/14/2018 20:21:58 natcap.invest.ui.model INFO Execution finished

08/14/2018 20:21:58 natcap.invest.utils INFO Elapsed time: 45.14s

08/14/2018 20:21:58 natcap.invest.ui.execution ERROR Target <function _logged_target at 0x023E01F0> 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\sdr.py", line 205, in execute

File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\sdr.py", line 554, in _calculate_w

File "site-packages\pygeoprocessing\geoprocessing.py", line 1207, in reclassify_raster

File "site-packages\pygeoprocessing\geoprocessing.py", line 198, in raster_calculator

File "site-packages\pygeoprocessing\geoprocessing.py", line 1201, in _map_dataset_to_value_op

ValueError: The following 1 raster values [0] from "D:\MESTRADO\dinamica\SDR_WOKSPACE\aligned_lulc.tif" do not have corresponding entries in the `value_map`: {2.0: 0.0, 3.0: 0.01, 4.0: 0.01, 5.0: 0.0005, 6.0: 0.0005, 7.0: 0.0001, 8.0: 0.0001, 9.0: 0.02, 11.0: 0.1, 12.0: 0.1, 13.0: 0.1, 15.0: 0.1, 18.0: 0.02, 19.0: 0.02, 20.0: 0.02, 21.0: 0.1, 22.0: 0.02, 30.0: 0.0001}

08/14/2018 20:21:58 natcap.invest.ui.execution INFO Execution finished






























































































1360 x 768 - 226K
Post edited by MARIANER on

Comments

  • swolnyswolny Member, NatCap Staff
    Hi @MARIANER -

    I have also seen this happen recently, and it appears to be an issue with the model, which the software team is working to fix. Can you confirm this by looking at the output file D:\MESTRADO\dinamica\SDR_WOKSPACE\aligned_lulc.tif? See if there is an area where the model has assigned a value of 0, but there shouldn't be data, usually outside of your area of interest. 

    ~ Stacie
  • jdouglassjdouglass Administrator, NatCap Staff
    We just recently released a new version of InVEST that I believe fixes this issue.  Could you try out the latest version of InVEST (3.5.0) at http://naturalcapitalproject.org/invest/ and see if it does fix it for you?  Let us know if it doesn't!

  • Hi, looking at the previous posts I saw a person with the same error, in the comments there was a 3.4.4 version recommended. I unmasked the version I was using and installed this 3.4.4. The template ran without the error displayed.


    At the moment I am with other activities as soon as I have a low time for this new test version.
Sign In or Register to comment.