-
Notifications
You must be signed in to change notification settings - Fork 446
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: validity of polygons #799
Comments
although there is a sense\value in result of some simple invalid polygons I've tested, my concern is of undefined behavior |
It's a good point. In general, the H3 library has erred on the side of less validation, unless invalid input is easy to identify or dangerous from a perspective of memory access/security/etc. The principle here is that our job is to be fast, and the user may or may not desire validation instead of speed. As a result, many of the H3 functions have a garbage in, garbage out approach, and to avoid this the caller needs to perform their own validation as appropriate. This applies for |
Thank you! Perhaps the validity checks can be an optional flag in "polygonToCells" arguments.... The reason for this would be internal pointInPlygon check (inside polygonToCells) that may perceive polygon differently than the outside world, in terms of edges (planar\geodesics), precicion, borders inclusion .... |
Hi,
It seems that the function accepts invalid polygons, for example X-shape (edges cross one another) and inner rings cross outer ring. I would expect for the function to return error and not produce results. Is this behavior on purpose? Can this behavior change in future? Is there a support for such checks or should I perform such checks separately?
Tested on version 3.x.
Thank you!
The text was updated successfully, but these errors were encountered: