# HRA model: The following stressor-habitat pair(s) do not have at least one exposure rating:

**URL:** <https://community.naturalcapitalalliance.org/t/hra-model-the-following-stressor-habitat-pair-s-do-not-have-at-least-one-exposure-rating/2188>\
**Category:** Software Support\
**Tags:** hra\
**Created:** [September 20, 2021, 12:14pm UTC](https://community.naturalcapitalalliance.org/t/hra-model-the-following-stressor-habitat-pair-s-do-not-have-at-least-one-exposure-rating/2188 "2021-09-20T12:14:42Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![kurapika](https://avatars.discourse-cdn.com/v4/letter/k/d07c76/32.png) [@kurapika](https://community.naturalcapitalalliance.org/u/kurapika)\
**Post date:** [September 20, 2021, 12:14pm UTC](https://community.naturalcapitalalliance.org/t/hra-model-the-following-stressor-habitat-pair-s-do-not-have-at-least-one-exposure-rating/2188/1 "2021-09-20T12:14:42Z")

</div>

I’m trying to run an HRA model with some random number I put into the CSV files, but I keep receiving this error:

The following stressor-habitat pair(s) do not have at least one exposure rating: [(‘RCF’, ‘Roads’), (‘RCF’, ‘MIN’), (‘RCF’, ‘OPL’), (‘RCF’, ‘SET’), (‘RCF’, ‘DCL’), (‘RCF’, ‘BRL’), (‘UDM’, ‘Roads’), (‘UDM’, ‘MIN’), (‘UDM’, ‘OPL’), (‘UDM’, ‘SET’), (‘UDM’, ‘DCL’), (‘UDM’, ‘BRL’), (‘DIM’, ‘Roads’), (‘DIM’, ‘MIN’), (‘DIM’, ‘OPL’), (‘DIM’, ‘SET’), (‘DIM’, ‘DCL’), (‘DIM’, ‘BRL’), (‘WAB’, ‘Roads’), (‘WAB’, ‘MIN’), (‘WAB’, ‘OPL’), (‘WAB’, ‘SET’), (‘WAB’, ‘DCL’), (‘WAB’, ‘BRL’)]

Here’s my data. Can anyone tell me what is wrong with it because I can’t seem to find anything? [Criteria scores.csv](https://community.naturalcapitalalliance.org/uploads/short-url/6kYXzwmsR1O0ap6VVV2GY5SPPjx.csv) (9.8 KB)

Here’s my log:  
[InVEST-Habitat-Risk-Assessment-log-2021-09-20–20\_15\_48.txt](https://community.naturalcapitalalliance.org/uploads/short-url/4ERlgWvvw38jz2KZvN6T2VaeyCC.txt) (7.2 KB)

---

<div class="post-metadata">

**Author:** ![dave](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dave/32/70_2.png) [@dave](https://community.naturalcapitalalliance.org/u/dave)\
**Post date:** [September 20, 2021, 1:28pm UTC](https://community.naturalcapitalalliance.org/t/hra-model-the-following-stressor-habitat-pair-s-do-not-have-at-least-one-exposure-rating/2188/2 "2021-09-20T13:28:16Z")

</div>

Hi @kurapika , thanks for posting. I happened to be debugging something else in this model the last couple days, so I will take a look at this problem as well. It could help to have your “Habitat Stressor Information” CSV. Could you upload that also please?

Thanks,

---

<div class="post-metadata">

**Author:** ![kurapika](https://avatars.discourse-cdn.com/v4/letter/k/d07c76/32.png) [@kurapika](https://community.naturalcapitalalliance.org/u/kurapika)\
**Post date:** [September 20, 2021, 1:39pm UTC](https://community.naturalcapitalalliance.org/t/hra-model-the-following-stressor-habitat-pair-s-do-not-have-at-least-one-exposure-rating/2188/3 "2021-09-20T13:39:57Z")

</div>

Hi Dave,

Thanks for your help. Here’s my Habitat Stressor Info too as requested.

[Habitat and stressor information .csv](https://community.naturalcapitalalliance.org/uploads/short-url/fFEqNGT8N2h9vw6loXbfZ20TmiT.csv) (2.0 KB)

---

<div class="post-metadata">

**Author:** ![dave](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dave/32/70_2.png) [@dave](https://community.naturalcapitalalliance.org/u/dave)\
**Post date:** [September 20, 2021, 2:14pm UTC](https://community.naturalcapitalalliance.org/t/hra-model-the-following-stressor-habitat-pair-s-do-not-have-at-least-one-exposure-rating/2188/4 "2021-09-20T14:14:51Z")

</div>

Thanks for that table. It looks like there is one habitat missing from the “info” table that is present in the “criteria” table: “RPL”. You can decide if that habitat should appear in both tables, or in neither. And we should update the model’s validation to give a more informative error message about that.

After resolving that, I expect you will encounter a very similar error that states: `The following stressor-habitat pair(s) do not have at least one **consequence** rating:`

I noticed that all the criteria are labelled “E” for exposure. At least one in each habitat-stressor pair will need to be a “C” consequence criteria. There is some guidance for these criteria in the User’s Guide. [Habitat Risk Assessment — InVEST documentation](http://releases.naturalcapitalproject.org/invest-userguide/latest/habitat_risk_assessment.html#exposure-and-consequence-criteria-in-more-detail)

Good luck,

---

<div class="post-metadata">

**Author:** ![kurapika](https://avatars.discourse-cdn.com/v4/letter/k/d07c76/32.png) [@kurapika](https://community.naturalcapitalalliance.org/u/kurapika)\
**Post date:** [September 20, 2021, 2:28pm UTC](https://community.naturalcapitalalliance.org/t/hra-model-the-following-stressor-habitat-pair-s-do-not-have-at-least-one-exposure-rating/2188/5 "2021-09-20T14:28:24Z")

</div>

Thank you so much for the insight! I’ll check it out and fix it as appropriate. The reason I included “Es” for all criteria is that I just wanted to test the output before going ahead with the actual correct criteria.

Thanks again!

---

<div class="post-metadata">

**Author:** ![kurapika](https://avatars.discourse-cdn.com/v4/letter/k/d07c76/32.png) [@kurapika](https://community.naturalcapitalalliance.org/u/kurapika)\
**Post date:** [September 21, 2021, 2:24am UTC](https://community.naturalcapitalalliance.org/t/hra-model-the-following-stressor-habitat-pair-s-do-not-have-at-least-one-exposure-rating/2188/6 "2021-09-21T02:24:09Z")

</div>

Hi Dave,

Your solution worked just fine. However, I encountered another problem that I cannot understand. Is there something wrong with one of my shapefiles?

AttributeError: ‘NoneType’ object has no attribute 'SimplifyPreserveTopology

You may find the data log here:  
[InVEST-Habitat-Risk-Assessment-log-2021-09-21–09\_37\_41.txt](https://community.naturalcapitalalliance.org/uploads/short-url/5B7gyirwS3ePhTIrZzDpOmbUxFh.txt) (11.3 KB)

Thank you for all your help

---

<div class="post-metadata">

**Author:** ![kurapika](https://avatars.discourse-cdn.com/v4/letter/k/d07c76/32.png) [@kurapika](https://community.naturalcapitalalliance.org/u/kurapika)\
**Post date:** [September 21, 2021, 7:20am UTC](https://community.naturalcapitalalliance.org/t/hra-model-the-following-stressor-habitat-pair-s-do-not-have-at-least-one-exposure-rating/2188/7 "2021-09-21T07:20:06Z")

</div>

Once I removed my roads shapefile, the model finally worked. So there has to be a problem with this shapefile, although I can’t figure out what I may be.

---

<div class="post-metadata">

**Author:** ![dave](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dave/32/70_2.png) [@dave](https://community.naturalcapitalalliance.org/u/dave)\
**Post date:** [September 21, 2021, 1:22pm UTC](https://community.naturalcapitalalliance.org/t/hra-model-the-following-stressor-habitat-pair-s-do-not-have-at-least-one-exposure-rating/2188/8 "2021-09-21T13:22:40Z")

</div>

Hi @kurapika , great to hear you are making progress.

> AttributeError: ‘NoneType’ object has no attribute 'SimplifyPreserveTopology

My guess is that this error indicates a feature in the Roads shapefile that has no actual geometry. You can probably find & delete that feature (or add some geometry to it) in GIS with a conditional selection expression; something like “geometry is NULL”. It will vary depending on what GIS software you are using.

---

<div class="post-metadata">

**Author:** ![kurapika](https://avatars.discourse-cdn.com/v4/letter/k/d07c76/32.png) [@kurapika](https://community.naturalcapitalalliance.org/u/kurapika)\
**Post date:** [September 21, 2021, 2:11pm UTC](https://community.naturalcapitalalliance.org/t/hra-model-the-following-stressor-habitat-pair-s-do-not-have-at-least-one-exposure-rating/2188/9 "2021-09-21T14:11:33Z")

</div>

That makes sense. Thank you for all your help!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/naturalcapitalproject/original/2X/8/8d95591aa074da87ea0fdd61ca47c1c3c0588aa7.png) [@system](https://community.naturalcapitalalliance.org/u/system)\
**Post date:** [September 28, 2021, 2:12pm UTC](https://community.naturalcapitalalliance.org/t/hra-model-the-following-stressor-habitat-pair-s-do-not-have-at-least-one-exposure-rating/2188/10 "2021-09-28T14:12:28Z")

</div>

Closed on September 28, 2021, 2:12pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
