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

Add utility function to orient MultiPolygons. #368

Merged
merged 1 commit into from
Feb 4, 2019

Conversation

zerebubuth
Copy link
Member

In the boundary code, we ensure that admin polygons are correctly oriented, with the interior on the left of their rings, before extracting those rings as boundary lines. However, the orient function from Shapely only handles Polygons, not MultiPolygons, and bails with an exception if it encounters a MultiPolygon. Sadly, many admin areas are indeed MultiPolygons. This adds a simple utility function to orient MultiPolygons by orienting all constituent Polygons.

In the boundary code, we ensure that admin polygons are correctly oriented, with the interior on the left of their rings, before extracting those rings as boundary lines. However, the orient function from Shapely only handles Polygons, not MultiPolygons, and bails with an exception if it encounters a MultiPolygon. Sadly, many admin areas are indeed MultiPolygons. This adds a simple utility function to orient MultiPolygons by orienting all constituent Polygons.
@zerebubuth zerebubuth merged commit 7d47872 into master Feb 4, 2019
@zerebubuth zerebubuth deleted the zerebubuth/fix-boundaries-orient-multipolygon branch February 4, 2019 21: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.

2 participants