m2p

a CLI utility to convert a multipolygon to a single polygon

Usage no npm install needed!

<script type="module">
  import m2p from 'https://cdn.skypack.dev/m2p';
</script>

README

This is a utility to merge a MultiPolygon into a single Polygon

This tool reads in a GeoJSON file containing two disconnected polygons. It finds the closest points of each polygon and then redraws the polygons with a single line connecting the two.

Setup

yarn install

Example

yarn run merge -i test.geojson -o out.json

Use it globally

Use Yarn

yarn add global m2p

Or NPM

npm install -g m2p

Then use it anywhere

m2p -i test.geojson -o output.json