Skip to content

Fix @turf/isobands issue with ring nesting logic #2925

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mfedderly
Copy link
Collaborator

@mfedderly mfedderly commented Jul 25, 2025

When working on removing marchingsquares, I noticed that the output of one of the isobands tests looked a bit strange in both the before and after versions of my change. When looking closer it was incorrectly nesting 'outer' ring polygons inside holes of other polygons. This breaks any donut-shaped bands.

Here's the matrix2 input data
image

Here's the original output showing the oddly shaped polygons that caught my attention.
image

Here's the version after the fix, which makes more sense:
image

@mfedderly mfedderly force-pushed the mf/isobands-ring-nesting-fix branch from ea00ac2 to 5ca0612 Compare July 25, 2025 17:19
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.

1 participant