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

Methods: polygonize and bounding_polygon are incomplete for non-contiguous 2d topologies #156

Open
Huite opened this issue Sep 4, 2023 · 0 comments

Comments

@Huite
Copy link
Collaborator

Huite commented Sep 4, 2023

Polygonize collects all possible polygons:

        collection = shapely.polygonize(shapely.linestrings(coordinates[edges]))
        polygon = max(collection.geoms, key=lambda x: _bbox_area(x.bounds))

This will work as desired with holes and such, but not if there e.g. two non-contiguous part of the mesh.

The correct check here would be to find the largest bounding boxes that are not contained by any other. Arguably the return object should be a MultiPolygon.

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

1 participant