Package Exports
- @spatial/mask
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@spatial/mask) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@spatial/mask
mask
Takes any type of polygon and an optional mask and returns a polygon exterior ring with holes.
Parameters
polygon(FeatureCollection | Feature<(Polygon | MultiPolygon)>) GeoJSON Polygon used as interior rings or holes.maskFeature<Polygon>? GeoJSON Polygon used as the exterior ring (if undefined, the world extent is used)
Examples
var polygon = turf.polygon([[[112, -21], [116, -36], [146, -39], [153, -24], [133, -10], [112, -21]]]);
var mask = turf.polygon([[[90, -55], [170, -55], [170, 10], [90, 10], [90, -55]]]);
var masked = turf.mask(polygon, mask);
//addToMap
var 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 module individually:
$ npm install @spatial/maskOr install the Turf module that includes it as a function:
$ npm install @turf/turf