-
-
Notifications
You must be signed in to change notification settings - Fork 37
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_polygon_to_cells: Invalid geometries can return millions of Hex IDs #157
Comments
We can definitely handle this more nicely. Principally I'm trying to keep the base |
@zachasme: The issue I ran into with my particular geometries is that |
I would be okay with adding a flag to the postgis variants of |
@zachasme: I think that could make sense. I got pulled off this but will be revisiting it in the next few weeks. Thoughts:
I would be OK with providing a flag, if it defaults to ON. We should verify that checking a flag at runtime isn't more expensive than calling |
@zachasme: Happy New Year! It looks like the risk of invalid memory access is gone, so that significantly simplifies things here (see: uber/h3-py#436 (comment) ). I'll clean this up in the next week. |
Thanks, and happy new year to you too! I'll get your work in #159 merged and fixed up for the new version. Then we can look at this afterwards! |
Issue:
I've found that calling
h3_polygon_to_cells
with invalid geometries can result in as many as 2.3 million hex_ids being returned at a resolution of 7. This is not a bug inh3-pg
but, rather how theh3
library handles invalid geometries. It's unclear whether we can guard against this, or should at the very least provide documentation/warnings about the issues and workarounds to mitigate them.Cause:
ST_IsValid()
.ST_MakeValid()
turns them in bow ties.Test case:
Solution:
ST_IsValid()
... or a warning that invalid geometries could return millions of hex ids?Upstream issue:
uber/h3#926
The text was updated successfully, but these errors were encountered: