turf icon indicating copy to clipboard operation
turf copied to clipboard

Isobands creating overlapping bands [5.0.4]

Open jpoynton opened this issue 7 years ago • 6 comments

Isobands has produced overlapping bands/polygons using 5.0.4

See https://jsfiddle.net/jpoynton/wmsx4y2e/ for example. Points in the example are colour coded so that green meet criteria for first break and purple meet criteria for second break with red being outside the breaks.

jpoynton avatar Nov 10 '17 11:11 jpoynton

@jpoynton this is an interesting case, indeed it seems the MarchingSquare algorithm is failing to map the correct intermediate contours. I know it might have some issue sometime but this is a new one. I'll look into it as soon as I can find some time, hopefully this weekend.

Out of curiosity, have you tried with a previous version of Turf?

stebogit avatar Nov 10 '17 17:11 stebogit

@stebogit have observed similar in 4.7.x with similar but different data. As I was just starting out with Turf thought it was my issue with wrong grid cell size I sampled at, so changed the grid size and made the issue go away.

jpoynton avatar Nov 10 '17 20:11 jpoynton

That's even more interesting @jpoynton. Would you please post the data not showing the issue so I can test it? Glad you found a workaround.

stebogit avatar Nov 10 '17 21:11 stebogit

@stebogit - increased the grid size from 0.25 mile to 0.5 mile and the polygons are fine - https://jsfiddle.net/jpoynton/wmsx4y2e/2/. For fun also reduced grid to 0.1 mile - https://jsfiddle.net/jpoynton/wmsx4y2e/3/

jpoynton avatar Nov 10 '17 21:11 jpoynton

We should re-test when/if #1801 lands.

Eh2406 avatar Dec 03 '19 20:12 Eh2406

PR mentioned above was superseded by PR #2527, now merged, so we should be good to retest this.

smallsaucepan avatar Dec 20 '23 13:12 smallsaucepan