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

Fix another geos error in _filter_structures_plane #2098

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

weiliangjin2021
Copy link
Collaborator

No description provided.

@weiliangjin2021 weiliangjin2021 added the Bug something isnt working label Dec 2, 2024
@weiliangjin2021
Copy link
Collaborator Author

Somehow normalize() fixes shapely.errors.GEOSException: TopologyException: side location conflict at ..... This can occur if the input geometry is invalid.. It works without buffer(0), but I just keep it to be safe.

I also shift things around to make it easier to follow.

Copy link
Collaborator

@tylerflex tylerflex left a comment

Choose a reason for hiding this comment

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

looks good to me, but this kind of shapely manipulation is outside of my knowledge at this point so feel free to get another review if needed.

Copy link
Collaborator

@momchil-flex momchil-flex left a comment

Choose a reason for hiding this comment

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

Approving if tests pass and this fixes the error users encountered, but I don't understand this either. :D @lucas-flexcompute ?

@lucas-flexcompute
Copy link
Collaborator

I've always disliked the buffer(0) hack, although that seems to be the only working option in some cases. And I guess normalize does more than the docs imply. There might be other places in the frontend where we use buffer(0) or make_valid that might also benefit from the normalize call. I don't think we need to test that in this PR, but we should remember that the next time we see GEOS/shapely errors.

@momchil-flex momchil-flex merged commit cf5aa27 into pre/2.8 Dec 3, 2024
15 checks passed
@momchil-flex momchil-flex deleted the weiliang/geos_fix branch December 3, 2024 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug something isnt working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants