turf
turf copied to clipboard
Isobands creating overlapping bands [5.0.4]
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 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 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.
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 - 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/
We should re-test when/if #1801 lands.
PR mentioned above was superseded by PR #2527, now merged, so we should be good to retest this.