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

cutoffs parameter has a limit of length 12 in r5, but not documented in r5r #216

Closed
botanize opened this issue Dec 20, 2021 · 5 comments
Closed
Assignees
Labels
v1.0 Features to be included in r5r 1.0

Comments

@botanize
Copy link

I got the following error when I attempted to provide a vector of 15 cutoff values to the accessibility function: java.lang.IllegalArgumentException: Maximum number of cutoffs allowed in a regional analysis is 12

@rafapereirabr
Copy link
Member

Hi @botanize . Thank you for opening the issue. I believe this is hardcoded upstream in R5. Perhaps @mvpsaraiva can confirm that.

@mvpsaraiva
Copy link
Collaborator

Interesting, I hadn't noticed that.
Indeed, R5 has a 12 cutoffs maximum hardcoded:

    /**
     * The largest number of cutoffs we'll accept in a regional analysis task. Too many cutoffs can create very large
     * output files. This limit does not apply when calculating single-point accessibility on the worker, where there
     * will always be 121 cutoffs (from zero to 120 minutes inclusive).
     */
    public static final int MAX_REGIONAL_CUTOFFS = 12;

Also, the maximum cutoff allowed is 120 minutes.
We need to document this in the accessibility() function.

@botanize
Copy link
Author

I documented and added checks on a branch in my fork, if you want I can create a pull request.

https://github.com/botanize/r5r/tree/cutoffs

@mvpsaraiva mvpsaraiva added the v1.0 Features to be included in r5r 1.0 label May 4, 2022
@dhersz
Copy link
Member

dhersz commented May 4, 2022

Thank you @botanize. We will be adding this check and relevant documentation on the next version.

@rafapereirabr
Copy link
Member

Thank you @botanize . I've now clarified this in the function documentation. This is already available in the dev version and will be included in the next release of r5r on CRAN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v1.0 Features to be included in r5r 1.0
Projects
None yet
Development

No branches or pull requests

4 participants