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

Overlay function or a way to mimic geopandas overlay #236

Open
shrikantnaidu opened this issue Feb 8, 2023 · 2 comments
Open

Overlay function or a way to mimic geopandas overlay #236

shrikantnaidu opened this issue Feb 8, 2023 · 2 comments

Comments

@shrikantnaidu
Copy link

Firstly, is the overlay function available? I'm not able to find it in the doc. Also, is there a way to do the exact thing overlay does with sjoin function?

@martinfleis
Copy link
Member

It is not available at the moment. See #217 (comment) for more details.

Also, is there a way to do the exact thing overlay does with sjoin function?

No, sjoin does not affect the geometries.

@Oreilles
Copy link

Oreilles commented Feb 28, 2023

There is a way to emulate overlay with the current API:

def overlay(left, right):
    return (
        left.sjoin(right.assign(right_geometry=right.geometry))
        .assign(geometry=lambda x: x.geometry.intersection(x.right_geometry))
        .drop(columns="right_geometry")
    )

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

No branches or pull requests

3 participants