An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# turf-voronoi

[![build status](https://secure.travis-ci.org/Turfjs/turf-voronoi.png)](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
```