Skip to content
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

Bug fix in pairwise_linestring_intersection #1069

Merged
merged 3 commits into from
Apr 17, 2023

Conversation

isVoid
Copy link
Contributor

@isVoid isVoid commented Apr 12, 2023

Description

This PR fixes a bug in pairwise_linestring_intersection, where point_flags is incorrectly used to remove points in points array due to leftover results from find_duplicate_points.

Previously, the code incorrectly assumed that point_flags will always be written to prior to merge_point_on_segment kernel, however, this may not be true if the result segment array is empty, and the kernel launch could be evaded, leading to that the second remove_if operates on the "leftover" from the previous point_flag ramnant.

This fix is to only run segment cleanup kernels if there is at least one segment result in the output. This not only fixes #1067 , but also serve as an optimization to avoid unnecessary kernel launching.

It should be pointed out that the result from python isn't exactly 1-1 matching with geopandas, as geopandas returns

0    MULTIPOINT (1.00000 1.00000, 0.00000 0.00000)
1    MULTIPOINT (1.00000 1.00000, 0.00000 0.00000)
2    MULTIPOINT (1.00000 1.00000, 0.00000 0.00000)

While cuspatial returns the result in 6 point rows with geometry offsets.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@isVoid isVoid requested review from a team as code owners April 12, 2023 20:18
@isVoid isVoid requested review from trxcllnt and harrism April 12, 2023 20:18
@github-actions github-actions bot added libcuspatial Relates to the cuSpatial C++ library Python Related to Python code labels Apr 12, 2023
@isVoid isVoid added bug Something isn't working non-breaking Non-breaking change labels Apr 12, 2023
@isVoid isVoid self-assigned this Apr 14, 2023
@harrism
Copy link
Member

harrism commented Apr 17, 2023

/merge

@rapids-bot rapids-bot bot merged commit 1598c65 into rapidsai:branch-23.06 Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working libcuspatial Relates to the cuSpatial C++ library non-breaking Non-breaking change Python Related to Python code
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

[BUG]: Problem with pairwise_linestring_intersection results
3 participants