UNPKG

dufour-peyton-intersection

Version:

Reference Implementation of the Dufour-Peyton Intersection Algorithm. Calculates the Intersections of Arbitrary Polygons with a Geospatial Raster.

10 lines (8 loc) 226 B
const rangeCut = require("./cut.js"); module.exports = function carve(insides, holes) { let results = insides; holes.forEach(hole => { results = results.map(pc => rangeCut(pc, hole)).flat(); }); return results; }