-
Notifications
You must be signed in to change notification settings - Fork 154
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
Adding Spherical Surface Processing Capability to Point-in-Polygon Queries #1212
Conversation
Pull requests from external contributors require approval from a |
auto p3left = is_left(p1, p2, p3); | ||
auto p4left = is_left(p1, p2, p4); | ||
|
||
auto alpha = dot(p1, p3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This says that if any of the end point of the arcs isn't in the same hemisphere, the arcs cannot intersect? Sounds like a very strict test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please cite the origin of this algorithm if you can @ayasar70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was an old paper, and I was not able to find it yet. If I cannot find it, I am going to work on the verification.
Co-authored-by: Michael Wang <isVoid@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making this contribution!
TYPED_TEST(PointInPolygonTest, OnePolygonOneRingSpherical) | ||
{ | ||
CUSPATIAL_RUN_TEST(this->run_spherical_test, | ||
{{-2503.357, -4660.203, 3551.245}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What CRS is this coordinate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those are projections that consider the world as a sphere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see, I remember you said this is the (X, Y, Z) coordinate using the center of earth as (0, 0, 0). For this algorithm it shouldn't matter how you choose the orthonormal basis as long as all coordinates are consistent. It would be nice to mention this in the docstring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution @ayasar70 ! This is my initial review. Various doc suggestions and a couple of algorithmic questions/suggestions.
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
Co-authored-by: Michael Wang <isVoid@users.noreply.github.com>
/ok to test |
Just realized CI hasn't been running for this PR! |
…he spherical surface
/ok to test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had one remaining unanswered question (about points on the boundary of the polygon. Please answer it before merging.
I will go ahead and approve. Nice work, and thank you. I note that this PR is just the beginning of support for this feature -- spherical PiP is only implemented in the C++ header-only API. To be a full feature it needs implementation in the column-based API and exposure in the Python API.
Thanks! Sorry, I missed the question before. I have replied. Just talked with @isVoid, after this PR I am going to start working on column-based API and Python API. |
/ok to test |
/merge |
Description
This PR aims to solve point-in-polygon queries using three-dimensional cartesian coordinates on spherical surfaces. Users may prefer to use that approach for more accurate computations.
This PR "closes #1202 "
Checklist