-
Notifications
You must be signed in to change notification settings - Fork 4
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
H3-Placekey round trip generating invalid results #44
Comments
thank you for reporting. it looks like your h3 input what the library currently does at h3 cell resolution 10 |
perhaps you can tell us how you get the h3 input - that might point us to the reason |
That particular H3 index was one of the ones we have in our system; I just started testing the Placekey API with it.
Does this mean that Placekey only works with indexes that are of resolution 10? |
that particular behavior might be undefined - we might not have discussed what should happen if an user provide a h3 cell (I assume it should snap to the resolution 10 cell) as of now Placekey is at res 10. its design can handle res 10-12. if you need a bigger area, have you consider https://h3geo.org/docs/api/regions/ ? |
We don't need a bigger area for our purposes. Mostly our H3 indexes are stand-ins for actual lat/longs so scaling them down is easy. Placekey not supporting resolutions higher than 10 is fine. But this behaviour isn't showing that. Placekey will happily generate a valid-looking Placekey value from an H3 index of resolution 4. But Placekey can't take this valid-looking value and turn it into a valid H3 index; instead it returns a garbage value. Better behaviour would be:
|
@isaacbrodsky - thoughts? |
We've discovered that converting a valid H3 Index to a Placekey and then converting it back generates an invalid H3 Index. Here's a test example:
Output:
Note that the output index is only different in the 2nd digit;
4
changes to ana
.We first discovered this using the Carto spatial library for Snowflake, which uses Placekey and H3 under the covers: https://docs.carto.com/data-and-analysis/analytics-toolbox-for-snowflake/sql-reference/placekey. The same bug exists there.
The text was updated successfully, but these errors were encountered: