Skip to content
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.polyfill fails for simple polygon, works for subpolygon #343

Open
ocker11 opened this issue Feb 19, 2024 · 0 comments
Open

h3.polyfill fails for simple polygon, works for subpolygon #343

ocker11 opened this issue Feb 19, 2024 · 0 comments

Comments

@ocker11
Copy link

ocker11 commented Feb 19, 2024

polyfill does not return any cells for a polygon but does return cells for a polygon contained within the failing polygon. Both avoid the poles and antimeridian.

Testcase:

print(h3.versions())

x1 = -141.001
x2 = -140.996
y1 = 61.895
y2 = 65.848
y_alt = 64.848

bad = {'type': 'Polygon',
       'coordinates': [[
           [x1, y1],
           [x2, y1],
           [x2, y2],
           [x1, y2],
           [x1, y1]
       ]]
     }

contained_poly = {'type': 'Polygon',
                  'coordinates': [[
                      [x1, y1],
                      [x2, y1],
                      [x2, y_alt],
                      [x1, y_alt],
                      [x1, y1]
                  ]]
                 }

print("Failing poly:", len(h3.polyfill(bad, 9, geo_json_conformant=True)), "cells")
print("Poly contained within failing poly:", len(h3.polyfill(contained_poly, 9, geo_json_conformant=True)), "cells")

Results:

{'c': '3.7.1', 'python': '3.7.6'}
Failing poly: 0 cells
Poly contained within failing poly: 896 cells
grim7reaper added a commit to HydroniumLabs/h3o that referenced this issue May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant