-
Notifications
You must be signed in to change notification settings - Fork 446
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
Ideas around 32-bit H3 indexes #320
Comments
The recommended storage/data interchange approach is to use hexidecimal strings - this is the most portable representation of an H3 index, and generally a good idea if you're using H3 indexes across different components or services. I'm not certain you'd get a lot of value out of a range index, as H3 indexes are not strictly in order (see this StackOverflow question. But if you really wanted to, you could devise a non-standard 32-bit truncated version. The structure of the index is outlined in the docs - you could use:
|
Closing, as this is more appropriate as a StackOverflow question than a GH issue (primarily for bugs and feature requests) |
@nrabinowitz Thank you for your reply. You did a great job answering my question. You're absolutely right that range indexing may not be the most optimal to due to the index values not being numerically ordered. The same problem exists even with Morton encoded values.
I've read that sentence often in the docs often. It might be made more clear to state that for resolution 1, the first 18 bits are used 3 bits for each digit, then each resolution level beyond 1 utilizes an additional three bits. Is my understanding incorrect? Also if every index value is the same resolution, you can drop the first four bits. So it hypothetically resolution 8 able to be achieved in 32 bits. |
I really like the H3 library and I'm thinking of integrating it into my application.
The databases I'm looking at using prefer values to be 32 bits or shorter in precision for range indexes. Specifically I'm thinking about the RTree extension to SQLite to index a range of H3 index values.
Is there a recommended way to truncate a H3 index to a fixed bit width resolution?
The text was updated successfully, but these errors were encountered: