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

s2_child_cell k is 0-indexed #225

Closed
sheffe opened this issue Apr 3, 2023 · 0 comments · Fixed by #230
Closed

s2_child_cell k is 0-indexed #225

sheffe opened this issue Apr 3, 2023 · 0 comments · Fixed by #230

Comments

@sheffe
Copy link

sheffe commented Apr 3, 2023

The docs show s2_cell_child(x, k) where k is an integer between 1 and 4 -- but pretty sure there's a zero-index on this and k is between 0 and 3.

example:

lapply(1L:4L, (function(k) s2::s2_cell_child(as_s2_cell("883b4"), k)))
# three child cells shown but last element is NA
lapply(0L:3L, (function(k) s2::s2_cell_child(as_s2_cell("883b4"), k)))
# all four child cells are valid

Can't tell if this is just a simple documentation fix, or if it might mean other off-by-one issues in functions using s2_cell_child.

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 a pull request may close this issue.

1 participant