Combines a FeatureCollection of Point, LineString, or Polygon features into MultiPoint, MultiLineString, or MultiPolygon features.
npm install @turf/combineCombines a [FeatureCollection][1] of [Point][2], [LineString][3], or [Polygon][4] features
into [MultiPoint][5], [MultiLineString][6], or [MultiPolygon][7] features.
* fc [FeatureCollection][1]<([Point][2] | [LineString][3] | [Polygon][4])> a FeatureCollection of any type
``javascript
var fc = turf.featureCollection([
turf.point([19.026432, 47.49134]),
turf.point([19.074497, 47.509548])
]);
var combined = turf.combine(fc);
//addToMap
var addToMap = [combined]
`
Returns [FeatureCollection][1]<([MultiPoint][5] | [MultiLineString][6] | [MultiPolygon][7])> a FeatureCollection of corresponding type to input
[1]: https://tools.ietf.org/html/rfc7946#section-3.3
[2]: https://tools.ietf.org/html/rfc7946#section-3.1.2
[3]: https://tools.ietf.org/html/rfc7946#section-3.1.4
[4]: https://tools.ietf.org/html/rfc7946#section-3.1.6
[5]: https://tools.ietf.org/html/rfc7946#section-3.1.3
[6]: https://tools.ietf.org/html/rfc7946#section-3.1.5
[7]: https://tools.ietf.org/html/rfc7946#section-3.1.7
---
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.
Install this single module individually:
`sh`
$ npm install @turf/combine
Or install the all-encompassing @turf/turf module that includes all modules as functions:
`sh``
$ npm install @turf/turf