Turf.jsFeature Conversion

turf.combine

What is turf.combine?

turf.combine takes a FeatureCollection of Point, LineString, or Polygon features and returns a FeatureCollection where features of the same type are combined into their Multi variants (MultiPoint, MultiLineString, MultiPolygon).

JavaScript
turf.combine(featureCollection) → FeatureCollection<Multi*>

When would you use turf.combine?

Use turf.combine to reduce a long list of single features into one Multi geometry — handy before serialising to a database that prefers fewer rows, or when you need to treat many parts as a single feature in downstream logic (e.g. unioning, dissolving, or styling).

On MapLibre, combining 10,000 individual point features into a single MultiPoint can speed up rendering because there is only one feature to style and track. In Node.js, it is a common step when converting a FeatureCollection into a TopoJSON or shapefile export.

Code
undefined

FAQs

Does it merge properties from input features?

No — the resulting Multi feature has empty (or first-feature's) properties, depending on version. If you need to aggregate attributes, do so manually after combining.

How does it differ from turf.union or turf.dissolve?

turf.combine simply groups features into Multi geometries without changing topology. turf.union and turf.dissolve merge overlapping or adjacent polygons into single combined shapes — they change geometry. Use combine when you want lossless grouping.

How do I install just combine?

npm install @turf/combine. It depends on @turf/meta and @turf/helpers.

Can I combine a mixed FeatureCollection?

Yes — the output FeatureCollection can contain a MultiPoint, MultiLineString, and MultiPolygon feature, one per input geometry type.