Class: VoronoiDiagramBuilder

jsts.triangulate.VoronoiDiagramBuilder

new VoronoiDiagramBuilder()

A utility class which creates Voronoi Diagrams from collections of points. The diagram is returned as a GeometryCollection of Polygons, clipped to the larger of a supplied envelope or to an envelope determined by the input sites.
Author:
  • Martin Davis
Source:

Methods

getDiagram(geomFact) → {jsts.geom.GeometryCollection}

Gets the faces of the computed diagram as a GeometryCollection of Polygons, clipped as specified.
Parameters:
Name Type Description
geomFact jsts.geom.GeometryFactory the geometry factory to use to create the output.
Source:
Returns:
the faces of the diagram.
Type
jsts.geom.GeometryCollection

getSubdivision() → {jsts.triangulate.quadedge.QuadEdgeSubdivision}

Gets the QuadEdgeSubdivision which models the computed diagram.
Source:
Returns:
the subdivision containing the triangulation.
Type
jsts.triangulate.quadedge.QuadEdgeSubdivision

setClipEnvelope(clipEnv)

Sets the envelope to clip the diagram to. The diagram will be clipped to the larger of this envelope or an envelope surrounding the sites.
Parameters:
Name Type Description
clipEnv jsts.geom.Envelope the clip envelope.
Source:

setSites()

Sets the sites of the builder. Will call correct setSites* based on arguments
Source:

setSitesByArray(coords)

Sets the sites (point or vertices) which will be diagrammed from a collection of Coordinates.
Parameters:
Name Type Description
coords Array.<jsts.geom.Coordinate> an array of Coordinates.
Source:

setSitesByGeometry(geom)

Sets the sites (point or vertices) which will be diagrammed. All vertices of the given geometry will be used as sites.
Parameters:
Name Type Description
geom jsts.geom.Geometry the geometry from which the sites will be extracted.
Source:

setTolerance(tolerance)

Sets the snapping tolerance which will be used to improved the robustness of the triangulation computation. A tolerance of 0.0 specifies that no snapping will take place.
Parameters:
Name Type Description
tolerance number the tolerance distance to use.
Source: