Skip to content

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

Merged
mfedderly merged 2 commits intomasterfrom
mf/isobands-ring-nesting-fix
Aug 31, 2025
Merged

Fix @turf/isobands issue with ring nesting logic#2925
mfedderly merged 2 commits intomasterfrom
mf/isobands-ring-nesting-fix

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
@mfedderly mfedderly merged commit 2dcf7dd into master Aug 31, 2025
3 checks passed
@mfedderly mfedderly deleted the mf/isobands-ring-nesting-fix branch August 31, 2025 10:20
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