https://github.com/turfjs/turf-voronoi
Create voronoi polygons from a set of points
https://github.com/turfjs/turf-voronoi
Last synced: 21 days ago
JSON representation
Create voronoi polygons from a set of points
- Host: GitHub
- URL: https://github.com/turfjs/turf-voronoi
- Owner: Turfjs
- License: mit
- Created: 2014-12-20T06:02:57.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-10-21T20:30:33.000Z (over 10 years ago)
- Last Synced: 2025-02-28T00:29:26.054Z (over 1 year ago)
- Language: JavaScript
- Homepage: http://turfjs.org/
- Size: 180 KB
- Stars: 4
- Watchers: 12
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# turf-voronoi
[](http://travis-ci.org/Turfjs/turf-voronoi)
turf voronoi module
### `turf.voronoi(points)`
Under Development - Not ready for use!
Takes a set of Point|points and
creates [Voronoi Polygons](https://en.wikipedia.org/wiki/Voronoi_diagram),
returned as a collection of Polygons. These are often used
for partitioning in to regions called Voronoi cells.
### Parameters
| parameter | type | description |
| --------- | ---------------------------- | ------------ |
| `points` | FeatureCollection\.\ | input points |
### Example
```js
// generate some random point data
var points = turf.random('points', 30, {
bbox: [50, 30, 70, 50]
});
var voronoi = turf.voronoi(points);
//=voronoi
```
**Returns** `FeatureCollection.`, Voronoi output
## Installation
Requires [nodejs](http://nodejs.org/).
```sh
$ npm install turf-voronoi
```
## Tests
```sh
$ npm test
```