-
Notifications
You must be signed in to change notification settings - Fork 7k
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
add remaining h3 miscellaneous functions #34568
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to generalize h3PointDistRads, h3PointDistM, h3PointDistKm. And make h3GetRes0Indexes return constant.
@bharatnc could you please provide fixes ? |
Yes, I will work on the fixes next. |
@kitaisreal I've made those changes, PR is ready for another round of reviews. |
src/Functions/h3GetRes0Indexes.cpp
Outdated
|
||
auto data = ColumnArray::create(ColumnUInt64::create()); | ||
/// res0_indexes contains all indexes with resolution 0 as returned by the h3 getRes0Cells function | ||
const Array res0_indexes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, we just need to create ColumnArray, then create ColumnUInt64, and in ColumnUInt64 pass result of h3 function call.
Current implementation will always allocate big array of Field
type, and writing such constants manual by hand are error-prone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed to remove hard coded constant.
However, I need some help to figure out how to pass results of h3 func to ColumnUInt64 directly without copying the results into an intermediate Array and then inserting that into ColumnArray. When I tried to do return ColumnArray::create(std::move(res))
I wasn't able to do it without the offsets i.e it looks like ColumnArray::create expects offsets along with the data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kitaisreal can you take another look here. Would be nice to have some pointers to instantiate the result of h3 function call directly to ColumnArray without having to deal with offsets or intermediate array.
1f980a9
to
efa8b1e
Compare
efa8b1e
to
c0fbf32
Compare
c0fbf32
to
9b770a9
Compare
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Add
h3PointDistM
,h3PointDistKm
,h3PointDistRads
,h3GetRes0Indexes
,h3GetPentagonIndexes
functions.This PR adds the remaining H3 miscellaneous functions as per: https://h3geo.org/docs/api/misc which are missing.
cc: @kitaisreal
Related to: #17708