geo_to_cells() for a global polygon?
#485
Replies: 1 comment
-
|
Thanks for asking! Improving support for "global" polygons is something I've been thinking about recently. I'd love to improve support in the upstream C library, which would carry over to h3-py. Your understanding of the current library behavior is correct. The First, I think we could improve the documentation to make these limitations clear on both https://h3geo.org and https://uber.github.io/h3-py/intro.html. We currently don't document the geometric assumptions very well (planar interpretation of polygon edges, winding order behavior, or limitations for large polygons). We should fix that. And if you have any suggestions (or want to put up a PR!) for the h3-py docs, that would be more than welcome. Second, how do we improve support for global polygons going forward? My thinking has been toward a new "geodesic" mode (uber/h3#1052) that @holoskii has kicked off. The existing mode in To resolve the "which interior do you mean" ambiguity, a geodesic mode for H3 could adopt assumptions like:
With assumptions like those, we should theoretically be able to handle general globe-spanning polygons. In the short term, approaches like uber/h3#1052 may still need to constrain input polygons to be contained within a hemisphere. From there we can improve the algorithms and relax those constraints over time. I think uber/h3#1052 is the right next step toward supporting global polygons. But I would also love to hear other thoughts or ideas on this. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Consider the following example:
gives
i.e. it interprets the polygon not as the one that spans almost the entire globe, but as the smaller counterpart. And it seems to do that regardless of the orientation of the polygon ring.
In the Polygon tutorial there is a section https://uber.github.io/h3-py/polygon_tutorial.html#h3-polygons-don-t-need-to-follow-the-right-hand-rule about the orientation. And it seems to indicate that it will essentially ignore the orientation of the rings of the input, which I assume means it uses the rule of "smallest area" to know which polygon is described?
But that then also means you cannot really pass a polygon larger than half the globe to
geo_to_cells()?Beta Was this translation helpful? Give feedback.
All reactions