Skip to content
On this page

geos.GEOSVoronoiDiagram ⇒ number

Computes a Voronoi diagram from the vertices of the given geometry.

Kind: Exported member
Returns: number - A pointer to the geometry representing the Voronoi diagram. Returns NULL on exception.

ParamTypeDescription
gnumberThe geometry pointer whose vertices to use as sites for Voronoi diagram generation.
envnumberA pointer to an optional clipping envelope (GEOSGeometry). If provided, only cells which lie in this envelope will be included in the result. This can be used to avoid constructing very large cells (such as those which are far away from all sites). If NULL, no clipping envelope is used.
tolerancenumberThe snapping tolerance to use for improved robustness. A tolerance of 0.0 specifies that no snapping will take place.
onlyEdgesnumberIf non-zero, only the edges of the Voronoi diagram will be returned, forming a multilinestring. If zero, the cells will be returned as a collection of polygons.

geos.GEOSVoronoiDiagram_r ⇒ number

Computes a Voronoi diagram from the vertices of the given geometry using a GEOS context handle.

Kind: Exported member
Returns: number - A pointer to the geometry representing the Voronoi diagram. Returns NULL on exception.

ParamTypeDescription
handlenumberThe GEOS context pointer handle.
gnumberThe geometry pointer whose vertices to use as sites for Voronoi diagram generation.
envnumberA pointer to an optional clipping envelope (GEOSGeometry). If provided, only cells which lie in this envelope will be included in the result. This can be used to avoid constructing very large cells (such as those which are far away from all sites). If NULL, no clipping envelope is used.
tolerancenumberThe snapping tolerance to use for improved robustness. A tolerance of 0.0 specifies that no snapping will take place.
onlyEdgesnumberIf non-zero, only the edges of the Voronoi diagram will be returned, forming a multilinestring. If zero, the cells will be returned as a collection of polygons.