-
Notifications
You must be signed in to change notification settings - Fork 157
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
Use quadtree for .contains_properly
#910
Use quadtree for .contains_properly
#910
Conversation
…ent colinearity checks break pip and need to be fixed.
python/cuspatial/cuspatial/tests/binpreds/test_contains_properly.py
Outdated
Show resolved
Hide resolved
python/cuspatial/cuspatial/tests/binpreds/test_contains_properly.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Michael Wang <isVoid@users.noreply.github.com>
# If there are 31 or fewer polygons in the input, the result | ||
# is a dataframe with one row per point and one column per | ||
# polygon. |
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.
One option would just be to change this output format before you consume it here. For the small-polygon-count version, just convert the bitmask into the same format output as the quadtree (all pairs): one row per intersection, containing a polygon index and a point index.
Then contains_properly only needs to convert the results if the user requests pairwise instead of all-pairs.
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.
Turns out it is really easy to change the output format with a cudf.stack()
call, so I'm investigating this approach to reduce code-paths.
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've finished that refactor, it makes solving the discrete math problem at the end harder but I'm ok with it for the current iteration of the architecture.
Please approve, this is ready for merge. I realized that the fundamental reason I've been grinding my teeth on this at all is because I keep trying to add small exceptions or refactorings to an architecture that isn't designed for it yet. I need to merge |
…om:thomcom/cuspatial into feature/use-quadtree-for-contains-properly
/merge |
Description
Closes #889
Closes #896
This PR makes a number of changes to the binpred system, including adding boundary exclusion for
.contains_properly
to the quadtree line-crossings algorithm.I've closed and then reopened this PR due to benchmark results that showed that using
pairwise
andcolumn-limited
forms of point-in-polygon don't offer any performance improvement but would just require more complicated code paths.Checklist