Class VoronoiDiagramBuilder
A utility class which creates Voronoi Diagrams from collections of points. The diagram is returned as a GeometryCollection of NetTopologySuite.Triangulate.Polygons, representing the faces of the Voronoi diagram. /// The faces are clipped to the larger of:
- an envelope supplied by ClipEnvelope.set.
- an envelope determined by the input sites.
Inherited Members
Namespace: NetTopologySuite.Triangulate
Assembly: NetTopologySuite.dll
Syntax
public class VoronoiDiagramBuilder
Properties
| Edit this page View SourceClipEnvelope
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.
Declaration
public Envelope ClipEnvelope { set; }
Property Value
Type | Description |
---|---|
Envelope |
Remarks
the clip envelope.
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.
Declaration
public double Tolerance { set; }
Property Value
Type | Description |
---|---|
double |
Remarks
tolerance the tolerance distance to use
Methods
| Edit this page View SourceGetDiagram(GeometryFactory)
Gets the faces of the computed diagram as a GeometryCollection of NetTopologySuite.Triangulate.Polygons, clipped as specified.
The UserData attribute of each face NetTopologySuite.Triangulate.Polygon is set to theCoordinate
of the corresponding input site.
This allows using a IDictionary<TKey, TValue> to link faces to data associated with sites.
Declaration
public GeometryCollection GetDiagram(GeometryFactory geomFact)
Parameters
Type | Name | Description |
---|---|---|
GeometryFactory | geomFact | the geometry factory to use to create the output |
Returns
Type | Description |
---|---|
GeometryCollection | a GeometryCollection containing the face NetTopologySuite.Triangulate.Polygons of the diagram |
GetSubdivision()
Gets the QuadEdgeSubdivision which models the computed diagram.
Declaration
public QuadEdgeSubdivision GetSubdivision()
Returns
Type | Description |
---|---|
QuadEdgeSubdivision | the subdivision containing the triangulation |
SetSites(Geometry)
Sets the sites (point or vertices) which will be diagrammed. All vertices of the given geometry will be used as sites.
Declaration
public void SetSites(Geometry geom)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom | geom the geometry from which the sites will be extracted. |
SetSites(ICollection<Coordinate>)
Sets the sites (point or vertices) which will be diagrammed from a collection of Coordinates.
Declaration
public void SetSites(ICollection<Coordinate> coords)
Parameters
Type | Name | Description |
---|---|---|
ICollection<Coordinate> | coords | a collection of Coordinates. |