Class ConvexHull
Computes the convex hull of a Geometry. The convex hull is the smallest convex Geometry that contains all the points in the input Geometry.
Uses the Graham Scan algorithm. Incorporates heuristics to optimize checking for degenerate results, and to reduce the number of points processed for large inputs.Inherited Members
Namespace: NetTopologySuite.Algorithm
Assembly: NetTopologySuite.dll
Syntax
public class ConvexHull
Constructors
| Edit this page View SourceConvexHull(Coordinate[], GeometryFactory)
Create a new convex hull construction for the input Coordinate array.
Declaration
public ConvexHull(Coordinate[] pts, GeometryFactory geomFactory)
Parameters
| Type | Name | Description |
|---|---|---|
| Coordinate[] | pts | The coordinate array |
| GeometryFactory | geomFactory | The factory to create the convex hull geometry |
ConvexHull(Geometry)
Create a new convex hull construction for the input Geometry.
Declaration
public ConvexHull(Geometry geometry)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry | geometry |
ConvexHull(IEnumerable<Coordinate>, GeometryFactory)
Create a new convex hull construction for the input Coordinate array.
Declaration
public ConvexHull(IEnumerable<Coordinate> pts, GeometryFactory geomFactory)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<Coordinate> | pts | |
| GeometryFactory | geomFactory | The factory to create the convex hull geometry |
Methods
| Edit this page View SourceCreate(IEnumerable<Geometry>)
Computes the convex hull for the given sequence of Geometry instances.
Declaration
public static Geometry Create(IEnumerable<Geometry> geoms)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<Geometry> | geoms | The Geometry instances whose convex hull to compute. |
Returns
| Type | Description |
|---|---|
| Geometry | The convex hull of |
GetConvexHull()
Returns a Geometry that represents the convex hull of the input point.
The point will contain the minimal number of points needed to
represent the convex hull. In particular, no more than two consecutive
points will be collinear.
Declaration
public Geometry GetConvexHull()
Returns
| Type | Description |
|---|---|
| Geometry | If the convex hull contains 3 or more points, a |