Turfjs / turf-intersect

find the intersection of features
30 stars 9 forks source link

Edge case bug #22

Open bwswedberg opened 4 years ago

bwswedberg commented 4 years ago

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 commented 4 years ago

FYI -- I ended up using polygon-clipping