Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions packages/turf-combine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

## combine

Combines a [FeatureCollection][1] of [Point][2], [LineString][3], or [Polygon][4] features
into [MultiPoint][5], [MultiLineString][6], or [MultiPolygon][7] features.
Combines a [FeatureCollection][1] of [Point][2], [MultiPoint][3], [LineString][4],
[MultiLineString][5], [Polygon][6], or [MultiPolygon][7] features
into [MultiPoint][3], [MultiLineString][5], or [MultiPolygon][7] features.

### Parameters

* `fc` **[FeatureCollection][1]<([Point][2] | [LineString][3] | [Polygon][4])>** a FeatureCollection of any type
* `fc` **[FeatureCollection][1]<([Point][2] | [MultiPoint][3] | [LineString][4] | [MultiLineString][5] | [Polygon][6] | [MultiPolygon][7])>** a FeatureCollection of Points, MultiPoints, LineStrings, MultiLineStrings, Polygons, or MultiPolygons

### Examples

Expand All @@ -25,19 +26,19 @@ var combined = turf.combine(fc);
var addToMap = [combined]
```

Returns **[FeatureCollection][1]<([MultiPoint][5] | [MultiLineString][6] | [MultiPolygon][7])>** a FeatureCollection of corresponding type to input
Returns **[FeatureCollection][1]<([MultiPoint][3] | [MultiLineString][5] | [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
[3]: https://tools.ietf.org/html/rfc7946#section-3.1.3

[4]: https://tools.ietf.org/html/rfc7946#section-3.1.6
[4]: https://tools.ietf.org/html/rfc7946#section-3.1.4

[5]: https://tools.ietf.org/html/rfc7946#section-3.1.3
[5]: https://tools.ietf.org/html/rfc7946#section-3.1.5

[6]: https://tools.ietf.org/html/rfc7946#section-3.1.5
[6]: https://tools.ietf.org/html/rfc7946#section-3.1.6

[7]: https://tools.ietf.org/html/rfc7946#section-3.1.7

Expand Down
5 changes: 3 additions & 2 deletions packages/turf-combine/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ import { feature, featureCollection } from "@turf/helpers";
import { featureEach } from "@turf/meta";

/**
* Combines a {@link FeatureCollection} of {@link Point}, {@link LineString}, or {@link Polygon} features
* Combines a {@link FeatureCollection} of {@link Point}, {@link MultiPoint}, {@link LineString},
* {@link MultiLineString}, {@link Polygon}, or {@link MultiPolygon} features
* into {@link MultiPoint}, {@link MultiLineString}, or {@link MultiPolygon} features.
*
* @function
* @param {FeatureCollection<Point|LineString|Polygon>} fc a FeatureCollection of any type
* @param {FeatureCollection<Point|MultiPoint|LineString|MultiLineString|Polygon|MultiPolygon>} fc a FeatureCollection of Points, MultiPoints, LineStrings, MultiLineStrings, Polygons, or MultiPolygons
* @returns {FeatureCollection<MultiPoint|MultiLineString|MultiPolygon>} a FeatureCollection of corresponding type to input
* @example
* var fc = turf.featureCollection([
Expand Down