turf-voronoi-delaunay
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

turf-voronoi-delaunay

Build Status Version Dependencies npm License

voronoi

Takes a FeatureCollection of points, and a bounding box, and returns a FeatureCollection of Voronoi polygons.

The Voronoi algorithim used comes from the d3-delaunay package.

Parameters

  • points FeatureCollection<Point> to find the Voronoi polygons around.

  • options Options Optional parameters (optional, default {keepProperties:false,bbox:[-180,-85,180,85]})

    • options.keepProperties boolean switch to enable/disable preservation of feature properties (optional, default false)
    • options.bbox BBox clipping rectangle, in [minX, minY, maxX, MaxY] order. (optional, default [-180,-85,180,85])

Examples

const options = {
  bbox: [-70, 40, -60, 60]
};
const points = turf.randomPoint(100, options);
const voronoiPolygons = voronoiDelaunay(points, options);

//addToMap
const addToMap = [voronoiPolygons, points];

Returns FeatureCollection<Polygon> a set of polygons, one per input point.


This module can be used together with the Turfjs project, an open source module collection dedicated to geographic algorithms. It is maintained in the Turfjs/turf repository.

Installation

Install this module:

$ npm install turf-voronoi-delaunay

To install the Turf module:

$ npm install @turf/turf

Package Sidebar

Install

npm i turf-voronoi-delaunay

Weekly Downloads

2

Version

0.0.3

License

MIT

Unpacked Size

11.7 kB

Total Files

6

Last publish

Collaborators

  • jrauschenbusch