mfedderly 15268af737
FeatureCollection args for @turf/difference @turf/intersect @turf/union (#2247)
* @turf/union - accept FeatureCollection for multiple inputs

* @turf/difference - accept FeatureCollection for multiple inputs

* @turf/intersect - accept FeatureCollection for multiple inputs

* @turf/hex-grid and @turf/triangle-grid - options.mask must be a Feature<Polygon>

* Fix examples
2022-01-17 16:37:14 -05:00

26 lines
440 B
TypeScript

import { featureCollection, polygon } from "@turf/helpers";
import intersect from "./index";
const poly1 = polygon([
[
[0, 0],
[1, 1],
[3, 0],
[0, 0],
],
]);
const poly2 = polygon([
[
[10, 10],
[21, 21],
[0, 4],
[10, 10],
],
]);
const match = intersect(featureCollection([poly1, poly2]));
if (match === null) console.log("foo");
const foo = intersect(featureCollection([poly1, poly2])) || "bar";