-
Notifications
You must be signed in to change notification settings - Fork 473
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
polygonToCells fails for some simple large polygons #521
Comments
Test case showing the problem:
results:
|
Thanks for the bug report and test case! I think your diagnosis here is sound, and we can take a look at potential fixes. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(Originally: uber/h3-py#202)
This polygon (nb: in degrees, not radians) causes
polygonToCells
to returnE_FAILED
(at resolution 5, probably true for other resolutions):I poked at this a bit and the problem AIUI is:
polygonToCells
ends up generating more than the "maximum" number of cells; becausemaxPolygonToCellsSize
underestimates the number of cells needed for this polygon; becausebboxHexEstimate
underestimates the number of cells neededFor this poly
bboxHexEstimate
returns 16037 cells at resolution 5. By messing withPOLYGON_TO_CELLS_BUFFER
I gotpolygonToCells
to run to completion, and it generated 20337 cells.My intuitive guess at what's going wrong is that
bboxHexEstimate
naively measures the distance between the two corners of the bounding box usingdistanceKm
. But this always returns the shorter great-circle arc, which for large bounding boxes is wrong (for this polygon, the shorter arc is not the diagonal of the bounding box)The text was updated successfully, but these errors were encountered: