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: avoid warning from deprecated explode in clip() #2179

Merged

Conversation

jorisvandenbossche
Copy link
Member

@@ -182,7 +182,7 @@ def clip(gdf, mask, keep_geom_type=False):
elif new_collection or more_types:
orig_type = gdf.geom_type.iloc[0]
if new_collection:
clipped = clipped.explode()
clipped = clipped.explode(index_parts=True)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the backwards compatible change, but, looking at this code now, we should actually set this to False? (we directly return this object, so which gets a MultiIndex in this case)

Copy link
Member

Choose a reason for hiding this comment

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

I think that short-term this should be False to avoid MultiIndex, the long-term we should filter geom types and dissolve the result back as you mentioned in #1667 (comment).

@jorisvandenbossche jorisvandenbossche merged commit 07b2671 into geopandas:master Oct 16, 2021
@jorisvandenbossche jorisvandenbossche deleted the overlay-warning branch October 16, 2021 06:23
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