turf-intersect icon indicating copy to clipboard operation
turf-intersect copied to clipboard

Edge case bug

Open bwswedberg opened this issue 6 years ago • 1 comments

I came across a strange edge case bug today--unless I am missing something. Anyways thanks for the awesome library.

Here is a way to test the edge case:

var poly1 = turf.polygon([[[0,0],[0,5],[5,5],[5,0],[0,0]]]);
var poly2 = turf.polygon([[[4,0],[4,5],[9,5],[9,0],[4,0]]]);

var intersection = turf.intersect(poly1, poly2);
// returns null -- but I expected it to return a polygon

bwswedberg avatar Mar 25 '20 19:03 bwswedberg

FYI -- I ended up using polygon-clipping

bwswedberg avatar Mar 26 '20 19:03 bwswedberg