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

Correctly check for LineString containment in Polygon #158

Merged
merged 2 commits into from
Sep 10, 2017

Conversation

urschrei
Copy link
Member

@urschrei urschrei commented Sep 6, 2017

The DE-9IM specification for containment states:

The interiors intersect and no part of the candidate's interior
or boundary intersects the base's exterior. It is possible for the boundaries to intersect.

For intersection

The two features are not disjoint

For disjoint

The boundaries and interiors do not intersect.

The current containment check deviates from this, in that it forbids
intersection (!self.intersects(linestring)), when in fact it should
be forbidding intersection with any interior rings. This PR fixes
that, and adds a test.

closes #157

urschrei added a commit to urschrei/geo that referenced this pull request Sep 6, 2017
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
urschrei added a commit to urschrei/geo that referenced this pull request Sep 10, 2017
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
urschrei added a commit to urschrei/geo that referenced this pull request Sep 10, 2017
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
@frewsxcv
Copy link
Member

lgtm! r=me once the merge conflict is addressed

The [DE-9IM specification for [`containment`]
(http://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Transformers/Transformers/spatialrelations.htm#DE9IM_Matrix) states:

> The **interiors intersect** and no part of the candidate's interior
or boundary intersects the base's exterior. It is possible for the boundaries to intersect.

For `intersection`:

> The two features are not disjoint

For `disjoint`

> The boundaries and interiors do not intersect.

The current containment check deviates from this, in that it forbids
intersection (`!self.intersects(linestring)`), when in fact it should
be forbidding intersection with any _interior rings_. This PR fixes
that, and adds a test.

closes georust#157
@urschrei urschrei force-pushed the containment_check_fix branch from d1ba7f4 to 0c9904a Compare September 10, 2017 16:33
@urschrei
Copy link
Member Author

r=frewsxcv

@frewsxcv
Copy link
Member

bors r=frewsxcv

bors bot added a commit that referenced this pull request Sep 10, 2017
158: Correctly check for LineString containment in Polygon r=frewsxcv a=urschrei

The DE-9IM specification for [`containment`](http://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Transformers/Transformers/spatialrelations.htm#DE9IM_Matrix) states:

> The **interiors intersect** and no part of the candidate's interior
or boundary intersects the base's exterior. It is possible for the boundaries to intersect.

For `intersection`

> The two features are not disjoint

For `disjoint`

> The boundaries and interiors do not intersect.

The current containment check deviates from this, in that it forbids
intersection (`!self.intersects(linestring)`), when in fact it should
be forbidding intersection with any _interior rings_. This PR fixes
that, and adds a test.

closes #157
@bors
Copy link
Contributor

bors bot commented Sep 10, 2017

Build succeeded

@bors bors bot merged commit 0c9904a into georust:master Sep 10, 2017
urschrei added a commit to urschrei/geo that referenced this pull request Sep 10, 2017
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
urschrei added a commit to urschrei/geo that referenced this pull request Sep 11, 2017
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
urschrei added a commit to urschrei/geo that referenced this pull request Sep 19, 2017
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
urschrei added a commit to urschrei/geo that referenced this pull request Sep 26, 2017
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
@urschrei urschrei deleted the containment_check_fix branch October 9, 2017 10:23
urschrei added a commit to urschrei/geo that referenced this pull request Oct 11, 2017
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
urschrei added a commit to urschrei/geo that referenced this pull request Oct 16, 2017
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
urschrei added a commit to urschrei/geo that referenced this pull request Nov 6, 2017
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
urschrei added a commit to urschrei/geo that referenced this pull request Jan 7, 2018
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
urschrei added a commit to urschrei/geo that referenced this pull request Jan 12, 2018
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
urschrei added a commit to urschrei/geo that referenced this pull request Jan 14, 2018
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
urschrei added a commit to urschrei/geo that referenced this pull request Jan 25, 2018
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
urschrei added a commit to urschrei/geo that referenced this pull request Jan 28, 2018
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
urschrei added a commit to urschrei/geo that referenced this pull request Feb 4, 2018
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
urschrei added a commit to urschrei/geo that referenced this pull request Mar 1, 2018
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
urschrei added a commit to urschrei/geo that referenced this pull request Mar 2, 2018
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
urschrei added a commit to urschrei/geo that referenced this pull request Mar 4, 2018
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
urschrei added a commit to urschrei/geo that referenced this pull request Mar 11, 2018
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
urschrei added a commit to urschrei/geo that referenced this pull request Mar 12, 2018
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
urschrei added a commit to urschrei/geo that referenced this pull request Mar 15, 2018
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
urschrei added a commit to urschrei/geo that referenced this pull request Mar 15, 2018
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
urschrei added a commit to urschrei/geo that referenced this pull request Mar 20, 2018
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
urschrei added a commit to urschrei/geo that referenced this pull request Mar 29, 2018
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
urschrei added a commit to urschrei/geo that referenced this pull request Apr 9, 2018
We're sticking to polygons which have convex hulls for now, and are
checking for that. The two failing tests are dependent upon georust#157
closing when georust#158 merges.
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.

Polygon-LineString containment check seems to be wrong
2 participants