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

Error in Habitat Quality model - InVEST 3.3.1

Hello,

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

Comments

  • 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\HabitatQuality.py", line 51, in <module>
        natcap.invest.habitat_quality.habitat_quality.execute(args)
      File "C:\Python27\ArcGIS10.3\lib\site-packages\natcap\invest\habitat_quality\habitat_quality.py", 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\habitat_quality.py", line 576, in check_projections
        srs.ImportFromWkt(dataset.GetProjection())
    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 http://data.naturalcapitalproject.org/nightly-build/invest-users-guide/html/habitat_quality.html#data-needs).

    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.