https://github.com/tmcw/geojson-flatten
flatten multipart geometries and geometrycollections in geojson
https://github.com/tmcw/geojson-flatten
Last synced: over 1 year ago
JSON representation
flatten multipart geometries and geometrycollections in geojson
- Host: GitHub
- URL: https://github.com/tmcw/geojson-flatten
- Owner: tmcw
- Created: 2014-01-02T20:45:13.000Z (over 12 years ago)
- Default Branch: main
- Last Pushed: 2023-10-07T07:23:06.000Z (almost 3 years ago)
- Last Synced: 2025-04-02T23:15:49.637Z (over 1 year ago)
- Language: JavaScript
- Size: 712 KB
- Stars: 52
- Watchers: 47
- Forks: 7
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# geojson-flatten
Flatten MultiPoint, MultiPolygon, MultiLineString, and GeometryCollection
geometries in [GeoJSON](http://geojson.org/) files into simple non-complex
geometries.
If a FeatureCollection is passed in, a FeatureCollection is returned. If a single Feature is passed in, an array of Features is returned.
## install
```
npm install --save geojson-flatten
```
Or download `geojson-flatten.js` for non-[browserify](http://browserify.org/) usage.
## example
```js
let flatten = require('geojson-flatten');
flattened = flatten(geojsonObject);
```