Merge a Set of Polygons with turf

turf has added quite a few features centered around spatial transformations recently. Mostly these types of operations involve tasks such as merging a bunch of polygons, or erasing one polygon from another.

There are lots of code examples in the docs, and the usage is very straightforward for anyone familiar with javascript and geojson.

To highlight one of these examples, here is how you would easily merge a feature collection of polygons together:

Note: since this example uses the filesystem, this needs to be in node.js, but if you had the objects in memory, it could be used in the browser. The results could then be displayed using leaflet or d3.