Skip to content

Rewrite @turf/isobands#2926

Merged
smallsaucepan merged 6 commits intomasterfrom
mf/rewrite-isobands
Nov 8, 2025
Merged

Rewrite @turf/isobands#2926
smallsaucepan merged 6 commits intomasterfrom
mf/rewrite-isobands

Conversation

@mfedderly
Copy link
Collaborator

Because marchingsquares has a somewhat conflicted licensing story, I went ahead and reimplemented it from scratch to clear up any ambiguity.

Performance is slower than isolines, but overall we're quite a bit faster than the original implementation (2-3x again).

The matrix2 issues are fixed in another PR.

Fixes #1084, #2509

Before After
bigMatrix x 487 ops/sec ±1.27% (83 runs sampled) bigMatrix x 1,358 ops/sec ±0.77% (94 runs sampled)
image image
matrix1 x 44,815 ops/sec ±0.26% (98 runs sampled) matrix1 x 84,368 ops/sec ±0.98% (97 runs sampled)
image image
matrix2 x 22,873 ops/sec ±0.24% (99 runs sampled) matrix2 x 47,717 ops/sec ±0.46% (100 runs sampled)
image image
pointGrid x 28,737 ops/sec ±0.27% (97 runs sampled) pointGrid x 55,908 ops/sec ±0.26% (99 runs sampled)
image image

Pretty sure this fixed #2509 as well. Here's a picture of the output I got, but since the test file is quite large I omitted adding it to permanent test cases since it isn't really clear what caused the issue in the first place.

image

@smallsaucepan smallsaucepan merged commit 8ccda4a into master Nov 8, 2025
3 checks passed
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.

@turf/isobands-In some cases, calculations can lead to dead cycles Isobands creating overlapping bands [5.0.4]

2 participants