explode
Quick answer
explode splits a MultiPolygon or MultiLineString into one feature per component and returns a FeatureCollection. It is the inverse of combine and is useful when you need per-part styling, identifiers or intersection tests. Inputs that are not multi geometries pass through as single-feature collections.
turf.explode( geojson ) → FeatureCollection
Key points
- Returns a FeatureCollection with one feature per component geometry.
- Properties from the source feature are copied onto every part.
- combine is the inverse operation and merges parts back together.
Example
var parts = turf.explode(multiPolygon);
console.log(parts.features.length);
parts.features.forEach(function (f) {
console.log(f.geometry.type, turf.area(f) / 1e6);
});
Notes
- Point and single-part inputs still wrap in a collection, changing downstream shape.
- Source feature ids are dropped unless you regenerate them.
English edition written for Atlaslog. Code is taken from the original Chinese page and runs unchanged.
Atlaslog (2026). explode. https://www.jingweizhi.com/en/turf/api/explode.html (accessed 2026-11-03).