node-red-contrib-tak-registration
Version:
A Node-RED node to register to TAK and to help wrap files as datapackages to send to TAK
75 lines (55 loc) • 1.88 kB
Markdown
by documentation.js. Update this documentation by updating the source code. -->
Takes any type of [polygon][1] and an optional mask and returns a [polygon][1] exterior ring with holes.
**Parameters**
- `polygon` **([FeatureCollection][2] \| [Feature][3]<([Polygon][4] \| [MultiPolygon][5])>)** GeoJSON Polygon used as interior rings or holes.
- `mask` **[Feature][3]<[Polygon][4]>?** GeoJSON Polygon used as the exterior ring (if undefined, the world extent is used)
**Examples**
```javascript
var polygon = turf.polygon([
[
[ ],
[ ],
[ ],
[ ],
[ ],
[ ],
],
]);
var mask = turf.polygon([
[
[ ],
[ ],
[ ],
[ ],
[ ],
],
]);
var masked = turf.mask(polygon, mask);
//addToMap
var addToMap = [masked];
```
Returns **[Feature][3]<[Polygon][4]>** Masked Polygon (exterior ring with holes).
[1]: https://tools.ietf.org/html/rfc7946#section-3.1.6
[2]: https://tools.ietf.org/html/rfc7946#section-3.3
[3]: https://tools.ietf.org/html/rfc7946#section-3.2
[4]: https://tools.ietf.org/html/rfc7946#section-3.1.6
[5]: https://tools.ietf.org/html/rfc7946#section-3.1.7
<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->
---
This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.
### Installation
Install this module individually:
```sh
$ npm install @turf/mask
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```
<!-- Generated