voronoigeom

1.3.2 • Public • Published

VoronoiGeom

A library for generating a voronoi diagram from any type of simple geometry

Voronoi diagram

Usage:

npm install voronoigeom

const voronoiGeom = require('voronoigeom');
 
const features = []; // an array of GeoJson Features
 
const voronoiPolys = voronoiGeom(features);
// an array of GeoJson Polygon Features
  function voronoiGeom(originalFeatures: GeometryFeature[], numEmpty = 0number, boundingFeature = undefinedPolygonFeature?): PolygonFeature[]
  • When passing in multi-geometries, a voronoi polygon is generated for each part of the multi-geom
  • In order to create additional Voronoi polygons (ie empty polygons), pass a number as the second argument to voronoiGeom.
  • In order to limit the created geometries by a polygon, add a geojson feature polygon as the third agrument

Limitations

This does not scale well, seems to work ok for < 500 features

Readme

Keywords

none

Package Sidebar

Install

npm i voronoigeom

Weekly Downloads

1

Version

1.3.2

License

BSD-3-Clause

Unpacked Size

336 kB

Total Files

5

Last publish

Collaborators

  • atlefren