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

DOC: Clarification in doc of intersects #1864

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

theroggy
Copy link
Contributor

@theroggy theroggy commented Aug 7, 2023

New pull request to test the readthedocs integration for pull requests.

Apparently the pull request has to be created after the readthedocs integration became active, so #1861 cannot be used to test it anymore.

@theroggy theroggy marked this pull request as ready for review August 7, 2023 16:53
@theroggy theroggy changed the title Clarification in doc of intersects DOC: Clarification in doc of intersects Aug 7, 2023
Copy link
Contributor

@sgillies sgillies left a comment

Choose a reason for hiding this comment

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

@theroggy I like your change, it's more clear. For the sake of completeness, can you restore the mention of overlaps and within?

@theroggy
Copy link
Contributor Author

theroggy commented Aug 8, 2023

@theroggy I like your change, it's more clear. For the sake of completeness, can you restore the mention of overlaps and within?

@sgillies I didn't keep that phrase because I'm not sure what is meant by it.

My interpretation would be that literally all of them (overlaps, within and touches) need to be True for intersects to be True, which is not the case. Even one of them having to be True is not the case, e.g. in the example below intersects is True but all of the other predicates are False.

So, I'm not sure how to interprete it and/or how to rephrase it.

import shapely

poly1 = shapely.Polygon([(0,0), (10,0), (10,10), (0,10), (0,0)])
poly2 = shapely.Polygon([(0,0), (5,0), (5,10), (0,5), (0,0)])

print(f"intersects: {shapely.intersects(poly1, poly2)}")
print(f"touches: {shapely.touches(poly1, poly2)}")
print(f"within: {shapely.within(poly1, poly2)}")
print(f"overlaps: {shapely.overlaps(poly1, poly2)}")

prints:

intersects: True
touches: False
within: False
overlaps: False

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.

None yet

2 participants