-
Notifications
You must be signed in to change notification settings - Fork 994
Closed
Description
I can not run the turf.mask() function with more than 9 random created circles. It just does not return any result but crashes.
import { featureCollection, polygon } from '@turf/helpers';
import createCircle from '@turf/circle';
import createMask from '@turf/mask';
const howManyCircles = 9;
const cover = polygon([
[[-180, -90], [180, -90], [180, 90], [-180, 90], [-180, -90]]
],
{ name: 'cover' });
const bbox = [83.16964204361335,83.47466091885153,-83.16964204362385,-83.47466091885192];
const randomPoints = randomPoint(howManyCircles, { bbox: bbox });
const radius = 1000;
const options = { steps: 64, units: 'kilometers', properties: { foo: 'bar' } };
const circles = randomPoints.features.map(points => {
return createCircle(points.geometry.coordinates, radius, options);
});
const mask = createMask(featureCollection(circles), cover);
This works as expected. There are nine holes (created through the randomPoints() and then circle() function) in the polygon.
However, as soon as I change howManyCircles to a number greater than 9, I do not get any result. It calculates and calculates but does not come to an end. Here is a fiddle to play around with: https://jsfiddle.net/6m3qsnu1/
Why is that?
"@turf/helpers": "^6.3.0",
"@turf/random": "^6.3.0",
"@turf/turf": "^6.3.0",
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels