Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
concavity?: number,
properties?: P,
} = {}): Feature | null {
// Default parameters
options.concavity = options.concavity || Infinity;
// Container
const points: number[][] = [];
// Convert all points to flat 2D coordinate Array
coordEach(geojson, (coord) => {
points.push([coord[0], coord[1]]);
});
if (!points.length) { return null; }
const convexHull = concaveman(points, options.concavity);
// Convex hull should have at least 3 different vertices in order to create a valid polygon
if (convexHull.length > 3) {
return polygon([convexHull]);
}
return null;
}