Skip to content

Latest commit

 

History

History
62 lines (37 loc) · 2.27 KB

README.md

File metadata and controls

62 lines (37 loc) · 2.27 KB

@turf/mask

mask

Takes polygons or multipolygons and an optional mask, and returns an exterior ring polygon with holes.

Parameters

Examples

const polygon = turf.polygon([[[112, -21], [116, -36], [146, -39], [153, -24], [133, -10], [112, -21]]]);
const mask = turf.polygon([[[90, -55], [170, -55], [170, 10], [90, 10], [90, -55]]]);

const masked = turf.mask(polygon, mask);

//addToMap
const addToMap = [masked]

Returns Feature<Polygon> Masked Polygon (exterior ring with holes)


This module is part of the Turfjs project, an open source module collection dedicated to geographic algorithms. It is maintained in the Turfjs/turf repository, where you can create PRs and issues.

Installation

Install this single module individually:

$ npm install @turf/mask

Or install the all-encompassing @turf/turf module that includes all modules as functions:

$ npm install @turf/turf