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

Check number of opportunities in destination layers used for regional analysis #928

Open
ansoncfit opened this issue Feb 1, 2024 · 0 comments
Assignees

Comments

@ansoncfit
Copy link
Member

We should add assertions that destination layers used in regional analysis have fewer than 2 billion opportunities.

With more than 2^31 opportunities, access results run the risk of overflow. We recently caught this with an assertion building the grids to display regional analysis results:

java.lang.IllegalStateException: Opportunity density should never be negative.
at com.google.common.base.Preconditions.checkState(Preconditions.java:512)
at com.conveyal.r5.analyst.Grid.write(Grid.java:303)

But we should fail faster, rather than waiting to violate an assertion after the analysis is complete.

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

No branches or pull requests

1 participant