-
Notifications
You must be signed in to change notification settings - Fork 511
feat: Implement gridRing #1011
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
feat: Implement gridRing #1011
Conversation
e4bbec6
to
d340990
Compare
Not quite sure why were getting these errors
when the test file has:
also my first time writing in C so any help is appreciated! |
The issue is because the declaration needs to be added to |
d340990
to
dceed5f
Compare
Thanks for this contribution! I will take a look in more detail. If you're comfortable, could you also add this function to |
Ah I didn't notice that
Would prefer if someone could help me do that in a followup, thank you :) |
dceed5f
to
12fd76a
Compare
This commit introduces a new public API function,
gridRing
, toretrieve H3 cells located at an exact grid distance
k
from an origincell, forming a "hollow" ring.
The implementation mirrors implementation of
gridDiskDistances
wherein we first attempt to use the unsafe version. If the unsafe
version fails, we fallback to
_gridRingInternal
._gridRingInternal
utilizes_gridDiskDistancesInternal
to get allcells up to distance
k
, then filters the output to only include thoseat exactly
k
.