mirror of
https://github.com/Turfjs/turf.git
synced 2026-01-25 16:07:00 +00:00
* @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
26 lines
440 B
TypeScript
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";
|