This forum is shutting down! Please post new discussions at

Error in Habitat Quality model - InVEST 3.3.1


I am using the natcap.invest package 3.3.1 and am trying to run the habitat quality model using the sample data provided on your webpage. However, when I fill out the necessary fields with the appropriate parameters and sample data, I get an error (see attached image). Is this a bug or am I missing something?

Thank you.
969 x 595 - 38K


  • Solution: the ERROR seemed to be linked to a single file missing inside the sample data folder. Maybe it was an older version of the sample data.

    ERROR: after fixing the above, I am now running into the following error:

    Traceback (most recent call last):
      File "C:\Users\Francesco Tonini\Dropbox\GITHUB-Projects\telecoupling-geoapp\Scripts\", line 51, in <module>
      File "C:\Python27\ArcGIS10.3\lib\site-packages\natcap\invest\habitat_quality\", line 149, in execute
        if not check_projections(landuse_uri_dict, 1.0):
      File "C:\Python27\ArcGIS10.3\lib\site-packages\natcap\invest\habitat_quality\", line 576, in check_projections
    AttributeError: 'NoneType' object has no attribute 'GetProjection'

    This seems to be related to the .GetProjection() function coming from the osgeo 'osr' module. Any idea how can I fix this or tips to start debugging it?

  • jdouglassjdouglass Administrator, NatCap Staff
    Hi @ftonini, Both of these exceptions are ultimately referring to the same thing ... the model is unable to find or open a file that it expects to exist and be a valid GDAL raster.  Habitat Quality has some pretty specific requirements for how its input data (especially the threat rasters) are laid out on disk (see

    The second error is happening because GDAL was unable to open a raster.  If you take a look at the cmd window that you used to launch the invest executable, you should see something like "ERROR 5: <some error text>", which will have the particular error string returned by GDAL.

    Hope this helps!
Sign In or Register to comment.