Dear Administrator,
I am currently running the sample data for the Habitat Quality module. I would like to conduct a sensitivity analysis by making a single adjustment to the maximum threat distance for urban threat sources. However, I am encountering an issue: when I adjust the maximum threat distance for urban areas from 10 km to 20 km, why does the habitat quality actually increase?
I look forward to your prompt response. Thank you!
Best regards,
ecozyp
Hi @ecozyp and welcome to the forum! Could you please provide a bit more detail about your issue? First, can you confirm that you’re entering max_dist in units meters (not km) and provide the version of InVEST you’re using? What output data are you looking at that indicates habitat quality increased?
Thank you!
I’ll also add that I just ran the Habitat Quality model with the sample data as is (scenario 1), and then ran the model a second time but set max_dist to 20000 for the urban threat (scenario 2) (it sounds like this is what you did?). I then subtracted quality_f_scenario2.tif (expected lower habitat quality due to urban threat affecting a greater area) from quality_f_scenario1.tif (expected higher habitat quality) and see that the ‘difference’ raster values range from 0 to 0.216. These positive values indicate higher quality habitat in the first scenario with lower urban maximum threat distance, which is what I would expect. I did the same thing for the “current” scenario option (quality_c.tif) and again see difference raster values that are all greater than or equal to 0.
Hello, @csimpson! Thank you very much for your patient response.
I am using InVEST version 3.12.0 on a Windows 11 system. The image shows the results I obtained. I noticed that when the `urban` `max_dist` is set to 10 km, the average value of `quality_c.tif` is 0.808; when the `urban` `max_dist` is set to 20 km, the average value of `quality_c.tif` is 0.814. Also, when I subtract the `quality_c.tif` from the 10 km setting from the one with a 20 km `urban` `max_dist`, the results range from -0.0003 to 0.036. I’m not sure why the `quality_c.tif` value increases as `max_dist` increases. I’m not sure if I’ve explained my issue clearly, so I’ve uploaded the result data for your reference.
If possible, could you let me know which version you are using? I’d like to try again following your steps.
I look forward to your prompt reply. Thank you!
Sincerely,
ecozyp
20km-InVEST-natcap.invest.habitat_quality-log-2026-08-13–09_25_31.txt (16.8 KB)
10km-InVEST-natcap.invest.habitat_quality-log-2026-08-13–09_28_49.txt (17.3 KB)
Hi @ecozyp and thanks very much for the updated information and logfile! I would highly recommend updating to the latest version of InVEST (3.20.0, which is what I used when testing this issue). A number of improvements have been made to the Habitat Quality model, including changes to how threat rasters are calculated. If you’re curious, the exact changes are detailed here: invest/HISTORY.rst at main · natcap/invest · GitHub. Additionally, as of InVEST 3.15.0, max_dist should be specified in meters (in 3.12 the units were still km).
Please let me know if you have any more questions!
Hello, @csimpson! Following your suggestion, I reran the data using InVEST (3.20.0), and the issue was completely resolved. As the urban max_dist increases, habitat quality begins to show a downward trend.
Thank you very much for your patience and guidance.
Best regards,
ecozyp
