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

Add pairwise_linestring_intersection_with_duplicates API #813

Merged

Conversation

isVoid
Copy link
Contributor

@isVoid isVoid commented Nov 22, 2022

Description

This PR adds internal function: pairwise_linestring_intersection_with_duplicates API. closes #785,

The API returns two structs: linestring_intersection_intermediates<vec_2d> and linestring_intersection_intermediates<segment>. This struct is important for following steps when removing duplicate geometries. Because the geometries and underlying look-back ids needs to be updated in tandem.

Notice I didn't go too hard on the test cases - result from intersection with duplicates is often hard to hand craft. I would rely on future integrated tests with end-to-end intersection to test the correctness of this function.

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 added feature request New feature or request non-breaking Non-breaking change labels Nov 22, 2022
@isVoid isVoid added this to the DE-9IM milestone Nov 22, 2022
@isVoid isVoid requested review from thomcom and harrism November 22, 2022 23:03
@isVoid isVoid self-assigned this Nov 22, 2022
@isVoid isVoid requested review from a team as code owners November 22, 2022 23:03
@isVoid isVoid requested a review from zhangjianting November 22, 2022 23:03
@github-actions github-actions bot added cmake Related to CMake code or build configuration libcuspatial Relates to the cuSpatial C++ library labels Nov 22, 2022
@isVoid isVoid changed the base branch from branch-22.12 to branch-23.02 November 22, 2022 23:05
Copy link
Contributor

@robertmaynard robertmaynard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving CMake changes

…into feature/intersection_with_duplicates_pr
@isVoid isVoid requested a review from harrism November 29, 2022 01:13
…into feature/intersection_with_duplicates_pr
@isVoid isVoid requested a review from thomcom December 5, 2022 23:49
Copy link
Member

@harrism harrism left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. This is pretty complicated, so I tried to provide a few ideas for simplification / DRY.

Copy link
Member

@harrism harrism left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one naming request but otherwise approve. Love the enumerated_range stuff!

@thomcom
Copy link
Contributor

thomcom commented Dec 13, 2022

The size of a GeoSeries and GeoDataFrame changed slightly with this PR, causing CI to fail. I'm rebuilding my rapids-compose now to try and reproduce, so far unable to.

@isVoid
Copy link
Contributor Author

isVoid commented Dec 13, 2022

rerun tests

@isVoid
Copy link
Contributor Author

isVoid commented Dec 13, 2022

@gpucibot merge

@rapids-bot rapids-bot bot merged commit c6d4b75 into rapidsai:branch-23.02 Dec 13, 2022
rapids-bot bot pushed a commit that referenced this pull request Dec 14, 2022
…851)

#813 adds a struct to hold the intermediate result from `linestring_intersection_with_duplicates`. After discovering the duplicates from the result, we need a way to remove these geometries from the struct, as well as updating the offsets and look-back ids. This PR adds a `remove_if` function to the struct, which models after `thrust::remove_if` that accepts a range of flags, and removes the geometries in the intermediates where the flag is set to 1.

Closes #853 
Depends on #813. Contributes to #765.

Authors:
  - Michael Wang (https://github.com/isVoid)

Approvers:
  - Mark Harris (https://github.com/harrism)
  - H. Thomson Comer (https://github.com/thomcom)

URL: #851
rapids-bot bot pushed a commit that referenced this pull request Dec 16, 2022
This PR adds header only API `pairwise_linestring_intersection`. Closes #765 .

Depends on #813 #818 #819 #851

Authors:
  - Michael Wang (https://github.com/isVoid)

Approvers:
  - Mark Harris (https://github.com/harrism)
  - H. Thomson Comer (https://github.com/thomcom)

URL: #852
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmake Related to CMake code or build configuration feature request New feature or request libcuspatial Relates to the cuSpatial C++ library non-breaking Non-breaking change
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Header-only Implementation of intersection_with_duplicates
4 participants