turf-union
Version:
find the union of geographic features
37 lines (25 loc) • 588 B
Markdown
turf-union
===
[](http://travis-ci.org/Turfjs/turf-union)
Combines to polygons into one.
```sh
npm install turf-union
```
name|description
---|---
polygon1|subject polygon
polygon2|polygon to add
```js
union(polygon1, polygon2)
```
###Example
```js
var union = require('turf-union')
var fs = require('fs')
var poly1 = JSON.parse(fs.readFileSync('/path/to/file1.geojson'))
var poly2 = JSON.parse(fs.readFileSync('/path/to/file2.geojson'))
var unioned = union(poly1, poly2)
```