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

impl Contains for all geometries #880

Merged
merged 2 commits into from
Aug 1, 2022
Merged

impl Contains for all geometries #880

merged 2 commits into from
Aug 1, 2022

Conversation

michaelkirk
Copy link
Member

@michaelkirk michaelkirk commented Jul 20, 2022

  • I agree to follow the project's code of conduct.
  • I added an entry to CHANGES.md if knowledge of this change could be valuable to users.

Based on the test suite and correctness fixes in #882 so please review that first.

Fixes #535

// (Geometry::Triangle(subject), Geometry::Triangle(target)) => { subject.contains(target) == relate_actual }
_ => true,
};
let direct_actual = subject.contains(target);
Copy link
Member Author

@michaelkirk michaelkirk Jul 20, 2022

Choose a reason for hiding this comment

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

This might look like I'm deleting test cases, but actually it's the opposite - we now verify that Contains matches Relate::is_contains for all test cases, rather than having to specify which ones.

@michaelkirk
Copy link
Member Author

I found some correctness issues with this while adding more of the JTS test suite, so I'm going to close for now.

(I'm actively working on it, so hopefully it won't be long before I re-open)

@michaelkirk michaelkirk marked this pull request as draft July 28, 2022 18:55
@michaelkirk michaelkirk changed the base branch from main to mkirk/jts-validation-suite July 28, 2022 18:56
@michaelkirk michaelkirk marked this pull request as ready for review July 28, 2022 18:56
@michaelkirk
Copy link
Member Author

I found some correctness issues with this while adding more of the JTS test suite, so I'm going to close for now.

Ok, I fixed these in #882, so once 882 is approved, this is ready for review.

@@ -10,6 +10,10 @@ pub use area::Area;
pub mod bearing;
pub use bearing::Bearing;

/// Boolean Ops such as union, xor, difference;
Copy link
Member Author

Choose a reason for hiding this comment

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

Trying to keep this file alphabetically organized.

Base automatically changed from mkirk/jts-validation-suite to main August 1, 2022 05:49
@michaelkirk
Copy link
Member Author

#882 has been merged! So this is ready for review.

Copy link
Contributor

@rmanoka rmanoka left a comment

Choose a reason for hiding this comment

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

lgtm!

@michaelkirk
Copy link
Member Author

bors r=rmanoka

@bors
Copy link
Contributor

bors bot commented Aug 1, 2022

Build succeeded:

@bors bors bot merged commit 4479d59 into main Aug 1, 2022
@bors bors bot deleted the mkirk/contains-all branch August 1, 2022 22:35
bors bot added a commit that referenced this pull request Aug 13, 2022
884: Adds Within trait and fixes more Contains edge cases r=frewsxcv a=michaelkirk

- [x] I agree to follow the project's [code of conduct](https://github.com/georust/geo/blob/main/CODE_OF_CONDUCT.md).
- [x] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users.
---

~~Based on #880, so review that first.~~ Merged! This is ready for review!

The new `Within` trait is implemented in terms of `Contains`. 

Running the "within" tests from the JTS suite exposed some further inconsistencies with how we're handling line string edge cases.

Co-authored-by: Michael Kirk <michael.code@endoftheworl.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add implementation: impl<T> Contains<T, Geometry<T>> for Geometry<T>
2 participants