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

Urban Nature Access: handle the case where an admin boundary doesn't overlap any people #1503

Closed
phargogh opened this issue Jan 12, 2024 · 2 comments · Fixed by #1510
Closed
Assignees
Labels
bug Something isn't working

Comments

@phargogh
Copy link
Member

A user on the forums encountered a ZeroDivisionError that appears to be caused by an admin boundary polygon that doesn't overlap any people in the population raster. The workaround suggested to the user was to locate that polygon and remove it from the vector until a fix can be implemented.

@phargogh phargogh added the bug Something isn't working label Jan 12, 2024
@phargogh
Copy link
Member Author

There is a question about how best to handle this case. As the denominator approaches 0 from the positive side where the available nature area is constant, then the value of the ratio will approach infinity. So what should be the value of the ratio saved in the vector? inf? 0? nan? I've asked Lisa and Roy on slack about this and am waiting to hear back.

@phargogh
Copy link
Member Author

From Lisa:

Let's go with NaN to treat it as undefined, and then state this in the user's guide. Since this is an urban model, I'd expect it's mostly likely to arise either when an admin unit is composed entirely of a park or other area with no residents or the user has input admin boundaries that extend beyond the the population raster. Even though the limit is approaching infinity, making it inf seems more prone to user misinterpretation or to generate misleading results in downstream analyses.

phargogh added a commit to phargogh/invest that referenced this issue Jan 23, 2024
phargogh added a commit to phargogh/invest that referenced this issue Jan 23, 2024
phargogh added a commit to phargogh/invest that referenced this issue Jan 23, 2024
phargogh added a commit to phargogh/invest that referenced this issue Jan 23, 2024
phargogh added a commit to phargogh/invest that referenced this issue Jan 23, 2024
@phargogh phargogh self-assigned this Jan 23, 2024
phargogh added a commit to phargogh/invest that referenced this issue Jan 24, 2024
phargogh added a commit to phargogh/invest that referenced this issue Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant