1.3.2 • Published 5 years ago

voronoigeom v1.3.2

Weekly downloads
-
License
BSD-3-Clause
Repository
-
Last release
5 years ago

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 = 0: number, boundingFeature = undefined: PolygonFeature?): 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

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago