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

BUG: Set operators are inconsistently handled #1255

Merged
merged 2 commits into from Apr 19, 2020

Conversation

martinfleis
Copy link
Member

Fixes #81

Set operators currently worked on GeoSeries but not on GeoDataFrame.

a = GeoSeries(...)
b = GeoDataFrame(...)

a.intersection(b)  # Okay
b.intersection(a)  # Okay
a & b  # Okay
b & a # Error

GeoDataFrame now supports operators as well using its geometry column.

@martinfleis martinfleis added the bug label Jan 5, 2020
@jorisvandenbossche
Copy link
Member

Question: do you personally use those operators?
I personally never have done that, and I find the methods also much more explicit (I have thought in the past to open an issue about this, to potentially deprecate it)

The PR itself looks good though!

@martinfleis
Copy link
Member Author

do you personally use those operators?

I don't. It is a bit confusing to understand what they do. But I can imagine some people may use them. I was just going through old issues and seen this, which was quite easy to fix.

I think there is no harm having these as a shortcut for intersection etc., if someone likes using operators.

@martinfleis martinfleis mentioned this pull request Feb 7, 2020
@martinfleis martinfleis added this to the 0.7.1 milestone Mar 27, 2020
@martinfleis martinfleis merged commit d550bb9 into geopandas:master Apr 19, 2020
@martinfleis martinfleis deleted the binary-operators_81 branch April 19, 2020 19:00
@martinfleis
Copy link
Member Author

Now we have consistent behaviour of set operators between GeoDataFrame and GeoSeries. We can still decide to deprecate it altogether.

@jorisvandenbossche
Copy link
Member

Personally I would deprecate them. Let's start with opening an issue for that?

@martinfleis
Copy link
Member Author

I'll do a quick PR straight away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set operators are inconsistently handled
2 participants