Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function union(fc) {
const args = [];
geomEach(fc, function (geom) {
if (geom.type === 'Polygon') args.push(geom.coordinates);
else geom.coordinates.forEach(function (contour) {
args.push(contour);
});
});
const unioned = polygonClipping.union(args);
if (unioned.length === 0) return null;
else return multiPolygon(unioned);
}