You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit introduces a new public API function, gridRing, to
retrieve H3 cells located at an exact grid distance k from an origin
cell, 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 all
cells up to distance k, then filters the output to only include those
at exactly k.
/home/runner/work/h3/h3/src/apps/testapps/testGridRing.c:32:35: error: call to undeclared function 'gridRing'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
32 | t_assertSuccess(H3_EXPORT(gridRing)(sfHex, 0, k0));
|
when the test file has:
#include "h3api.h"
also my first time writing in C so any help is appreciated!
/home/runner/work/h3/h3/src/apps/testapps/testGridRing.c:32:35: error: call to undeclared function 'gridRing'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
32 | t_assertSuccess(H3_EXPORT(gridRing)(sfHex, 0, k0));
|
when the test file has:
#include "h3api.h"
also my first time writing in C so any help is appreciated!
The issue is because the declaration needs to be added to h3api.h.in (which gets processed into h3api.h), otherwise the compiler isn't sure what that function looks like.
The issue is because the declaration needs to be added to h3api.h.in (which gets processed into h3api.h), otherwise the compiler isn't sure what that function looks like.
Ah I didn't notice that src/h3lib/include/h3api.h was local and in .gitignore, thanks!
Thanks for this contribution! I will take a look in more detail.
If you're comfortable, could you also add this function to fuzzerGridDisk so we get the full fuzzer coverage? (We can also add that in a follow up)
Would prefer if someone could help me do that in a followup, thank you :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit introduces a new public API function,
gridRing, toretrieve H3 cells located at an exact grid distance
kfrom an origincell, forming a "hollow" ring.
The implementation mirrors implementation of
gridDiskDistanceswherein we first attempt to use the unsafe version. If the unsafe
version fails, we fallback to
_gridRingInternal._gridRingInternalutilizes_gridDiskDistancesInternalto get allcells up to distance
k, then filters the output to only include thoseat exactly
k.