'NoneType' object has no attribute 'GetLayer' in HRA Model Version 3.6.0

CamilleCamille Member
edited February 12 in General
Hi,
I am a land use planning professional attached to thenational planning agency in my country. We are looking at ways to improve on evidence based decision making and have found the natural capital project useful. I am new to the Invest modelling process. My query is specific to the use of the HRA as well as the sample data for the Model (both 3.6.0 version).

There seems to be a problem with the subregion shapefile. The first error indicated Name was not included and was required. I checked the subregion shp in QGIS and Name is there in the attribute table. 

So I redid the entire process and now I am getting this error. 

Initializing...

Showing messages with level INFO and higher

02/12/2019 12:52:07 natcap.invest.utils INFO Writing log messages to C:\Users\camil\Documents\hra_workspace\InVEST-Habitat-Risk-Assessment-log-2019-02-12--12_52_07.txt

02/12/2019 12:52:07 natcap.invest.ui.model Level 100 Starting model with parameters:

Arguments for InVEST natcap.invest.habitat_risk_assessment.hra 3.6.0:

aoi_tables C:/Users/camil/Desktop/HabitatRiskAssess/Input/subregions.shp

csv_uri C:\Users\camil\Desktop\hra_preprocessor_workspace\habitat_stressor_ratings

decay_eq None

grid_size 200

max_rating 3

max_stress 2

n_workers -1

results_suffix

risk_eq Euclidean

workspace_dir C:\Users\camil\Documents\hra_workspace


02/12/2019 12:52:07 osgeo ERROR [errno 4] Unable to open C:\Users\camil\Desktop\Test folders for INVEST Model\HabitatLayers\DSGA_POLY.shx or C:\Users\camil\Desktop\Test folders for INVEST Model\HabitatLayers\DSGA_POLY.SHX.Try --config SHAPE_RESTORE_SHX true to restore or create it

02/12/2019 12:52:07 natcap.invest.ui.model ERROR Exception while executing <function execute at 0x13CAF930>

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 1579, in _logged_target

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

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

AttributeError: 'NoneType' object has no attribute 'GetLayer'

02/12/2019 12:52:07 natcap.invest.ui.model INFO Execution finished

02/12/2019 12:52:07 natcap.invest.utils INFO Elapsed time: 0.09s

02/12/2019 12:52:07 natcap.invest.ui.execution ERROR Target <function _logged_target at 0x1432CE30> failed with exception

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\execution.py", line 68, in run

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

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

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

AttributeError: 'NoneType' object has no attribute 'GetLayer'

02/12/2019 12:52:07 natcap.invest.ui.execution INFO Execution finished


I didnt attach any data as this is the data I downloaded from the website for HRA.

Can you assist?


Camille

Post edited by Camille on

Comments

  • DaveDave Member, Administrator, NatCap Staff
    Hi Camille,

    Is it possible your "DSGA_POLY.shp" somehow lost it's "DSGA_POLY.shx" file? Shapefiles are composed of several different files that all need to be located next to each. If you look in your file system (e.g. Windows Explorer) you should see DSGA_POLY.shp, DSGA_POLY.shx, DSGA_POLY.dbf, DSGA_POLY.prj and maybe others. The error suggests maybe the ".shx" file is missing. If so, maybe you can go back to the original source of the shapefile?
Sign In or Register to comment.