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
Some invalid geometries have made it into our dataset and are wreaking a bit of havoc in our H3 indexes.
h3_polygon_to_cells in the latest version of h3 returns 2,364,092 hex_ids for one of them.
These invalid geometries have 5 points, two points appear multiple times.
The geometry starts and ends at the same point.
We're using the latest h3-pg which uses h3 4.x
ST_MakeValid() function turns these into a bow-tie shape.
ST_IsValid() returns false.
I'm not sure if h3 should handle any of this or if we should always validate geometry before calling into it. Any thoughts?
Additional context:
We're using a flood fill strategy to convert polygons to h3 cells (the results of which are similar to Snowflake's h3_coverage). This strategy results in 50% less hex_ids on invalid inputs. This was still way too many, and before we found the root cause, we decided to test our implementation against h3_polygon_to_cells,. We were very surprised to see that we got double the hex_ids.
jmealo
changed the title
h3_polygon_to_cells: Handling of invalid geometry: 5 point polygon = 2.3 million hex_ids
h3_polygon_to_cells: Handling of invalid geometry: 5 point polygon = 2,364,092 hex_ids
Oct 10, 2024
jmealo
changed the title
h3_polygon_to_cells: Handling of invalid geometry: 5 point polygon = 2,364,092 hex_ids
h3_polygon_to_cells: Handling of invalid geometry: 5 point geometry = 2,364,092 hex_ids
Oct 10, 2024
Hello,
Some invalid geometries have made it into our dataset and are wreaking a bit of havoc in our H3 indexes.
h3_polygon_to_cells
in the latest version ofh3
returns 2,364,092 hex_ids for one of them.h3-pg
which usesh3
4.xST_MakeValid()
function turns these into a bow-tie shape.ST_IsValid()
returns false.I'm not sure if
h3
should handle any of this or if we should always validate geometry before calling into it. Any thoughts?Additional context:
We're using a flood fill strategy to convert polygons to h3 cells (the results of which are similar to Snowflake's
h3_coverage
). This strategy results in 50% less hex_ids on invalid inputs. This was still way too many, and before we found the root cause, we decided to test our implementation againsth3_polygon_to_cells
,. We were very surprised to see that we got double the hex_ids.Test case:
The text was updated successfully, but these errors were encountered: