Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rasterization of spatial criteria relative to InVEST 3.9 #1121

Conversation

phargogh
Copy link
Member

This PR restores a bit of functionality from the InVEST 3.9 HRA implementation that I had missed in the rewrite. In InVEST 3.9, habitat and stressor vectors are rasterized with ALL_TOUCHED=TRUE, while spatial criteria vectors are rasterized with ALL_TOUCHED=FALSE. The HRA rewrite was rasterizing everything as ALL_TOUCHED=TRUE, leading to the behavior discussed in https://community.naturalcapitalproject.org/t/habitat-risk-assessment-problems-with-risk-calculation-and-outputs/3122/14.

The HRA 3.9 behavior for spatial criteria seems reasonable to me, so I've restored it here and made sure that it's being tested.

No changes in the user's guide are needed for this since we're just restoring existing functionality.

Fixes #1120

Checklist

  • Updated HISTORY.rst and link to any relevant issue (if these changes are user-facing)
    - [ ] Updated the user's guide (if needed)
    - [ ] Tested the affected models' UIs (if relevant)

Only habitats and stressors should now be rasterized with
ALL_TOUCHED=TRUE.  Spatial criteria vectors should not be.

RE:natcap#1120
Copy link
Contributor

@davemfish davemfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me

@davemfish davemfish merged commit 4a7756c into natcap:main Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HRA regression when rasterizing spatial criteria
2 participants