-
Notifications
You must be signed in to change notification settings - Fork 996
Labels
Description
Running this code on v7.2.0 hangs and eventually ends in a OOME
import * as turf from '@turf/turf';
const poly1coords = [
[-2.232359, 53.349714],
[-2.23244, 53.349848],
[-2.232526, 53.349986],
[-2.23262, 53.350125],
[-2.232699, 53.350257],
[-2.232757, 53.350349],
[-2.232762, 53.350357],
[-2.232771, 53.350365],
[-2.232777, 53.350369],
[-2.232784, 53.350372],
[-2.23279, 53.350374],
[-2.232837, 53.350365],
[-2.232833, 53.35036],
[-2.232802, 53.350318],
[-2.232359, 53.349714],
];
const poly2coords = [
[-2.232359, 53.349714],
[-2.23244, 53.349848],
[-2.232526, 53.349986],
[-2.23262, 53.350125],
[-2.232699, 53.350257],
[-2.232757, 53.350349],
[-2.232762, 53.350357],
[-2.232771, 53.350365],
[-2.232777, 53.350369],
[-2.232784, 53.350372],
[-2.23279, 53.350374],
[-2.232834, 53.350366],
[-2.23283, 53.350359],
[-2.232808, 53.350326],
[-2.23281, 53.350329],
[-2.232802, 53.350318],
[-2.232359, 53.349714],
];
const poly1 = turf.polygon([poly1coords]);
const poly2 = turf.polygon([poly2coords]);
const intersection = turf.intersect(turf.featureCollection([poly1, poly2]));
The polygons are thin strips of land, almost entirely overlapping apart from the top-left corner:
I've tried running this in different environments (in a Node app, on a browser) and it hits the same error
Reactions are currently unavailable