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

Fix scatter bug due to overlapping range in pairwise_linestring_intersection #1152

Merged
merged 3 commits into from
May 26, 2023

Conversation

isVoid
Copy link
Contributor

@isVoid isVoid commented May 24, 2023

Description

This PR closes #1149

thrust::scatter does not perform in place scatter. As the document says:

The iterator result + i shall not refer to any element referenced by any iterator j in the range [first,last) for all iterators i in the range [map,map + (last - first)).

The input and output range must not overlap. However, currently in intersection there is overlap. This may cause a bad scatter that only happens when input is large (device dependent).

This PR also fixes a bug in find_duplicate_point kernel where the duplicate_flag was incorrectly referenced.

Additionally, this PR includes a fix to the python API to handle sparse geoseries.

Checklist

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

@github-actions github-actions bot added cmake Related to CMake code or build configuration libcuspatial Relates to the cuSpatial C++ library Python Related to Python code labels May 24, 2023
@isVoid isVoid added non-breaking Non-breaking change bug Something isn't working labels May 24, 2023
@isVoid isVoid marked this pull request as ready for review May 24, 2023 20:23
@isVoid isVoid requested review from a team as code owners May 24, 2023 20:23
@isVoid isVoid requested review from thomcom, trxcllnt and harrism May 24, 2023 20:23
@harrism harrism changed the title Fix a Bug in pairwise_linestring_intersection Fix scatter bug due to overlapping range in pairwise_linestring_intersection May 24, 2023
@harrism
Copy link
Member

harrism commented May 24, 2023

Added a little bit more descriptive title.

@thomcom
Copy link
Contributor

thomcom commented May 26, 2023

/merge

@rapids-bot rapids-bot bot merged commit 3bb733a into rapidsai:branch-23.06 May 26, 2023
rapids-bot bot pushed a commit that referenced this pull request Aug 4, 2023
Closes #1138
Closes #1141 [here](https://github.com/rapidsai/cuspatial/pull/1156/files#diff-c522c9afb3364b1aed2b2589c0d0c260dbc634bc54844536b1d382cecb92bf29R112)
Depends on #1152
Depends on #1064

Please direct your attention [to the notebook](https://github.com/rapidsai/cuspatial/pull/1156/files#diff-cc4c516f63efa822793d75315c1b28a04bad6c9efc6fd2bdcac5cc30b05d14dd) since the dependencies and delayed state of CI issues over this week have put a lot of files into this PR.

This notebook demonstrates cuSpatial's new binary predicates on large datasets, benchmarking and comparing against the host implementation on GeoPandas.

In order to support the large inputs for these comparisons I had to reactivate the `pairwise_point_in_polygon` functionality that I'd previously written off. This is because quadtree doesn't support large N for NxN operations, since it is many-to-many, and brute-force would require a huge number of iterations to support such large dataframes. There are some more optimizations that can be made to speed up `pairwise_point_in_polygon`, but the algorithm itself isn't sufficiently fast. It is detailed fairly closely in the notebook.

Please take a look and let's have some conversations about steps forward.

Authors:
  - H. Thomson Comer (https://github.com/thomcom)

Approvers:
  - Michael Wang (https://github.com/isVoid)
  - Mark Harris (https://github.com/harrism)
  - Ray Douglass (https://github.com/raydouglass)
  - AJ Schmidt (https://github.com/ajschmidt8)

URL: #1156
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cmake Related to CMake code or build configuration 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]: pairwise_linestring_intersection returns invalid offsets buffer
3 participants