Class ConcaveHullOfPolygons
Constructs a concave hull of a set of polygons, respecting the polygons as constraints. A concave hull is a possibly non-convex polygon containing all the input polygons. A given set of polygons has a sequence of hulls of increasing concaveness, determined by a numeric target parameter. The computed hull "fills the gap" between the polygons, and does not intersect their interior.
The concave hull is constructed by removing the longest outer edges of the Delaunay Triangulation of the space between the polygons, until the target criterion parameter is reached. The target criteria are:- Maximum Edge Lengththe length of the longest edge between the polygons is no larger than this value.
- Maximum Edge Length Ratiodetermine the Maximum Edge Length as a fraction of the difference between the longest and shortest edge lengths between the polygons. This normalizes the Maximum Edge Length to be scale-free. A value of 1 produces the convex hull; a value of 0 produces the original polygons.
Inherited Members
Namespace: NetTopologySuite.Algorithm.Hull
Assembly: NetTopologySuite.dll
Syntax
public class ConcaveHullOfPolygonsConstructors
| Edit this page View SourceConcaveHullOfPolygons(Geometry)
Creates a new instance for a given geometry.
Declaration
public ConcaveHullOfPolygons(Geometry polygons)Parameters
| Type | Name | Description | 
|---|---|---|
| Geometry | polygons | The input geometry | 
Properties
| Edit this page View SourceHolesAllowed
Gets or sets a flag indicating whether holes are allowed in the concave hull polygon.
Declaration
public bool HolesAllowed { get; set; }Property Value
| Type | Description | 
|---|---|
| bool | 
MaximumEdgeLength
Gets or sets the target maximum edge length for the concave hull. The length value must be zero or greater.
- The value 0.0 produces the input polygons.
- Larger values produce less concave results.
- Above a certain large value the result is the convex hull of the input.
Declaration
public double MaximumEdgeLength { get; set; }Property Value
| Type | Description | 
|---|---|
| double | 
MaximumEdgeLengthRatio
Gets or sets the target maximum edge length ratio for the concave hull. The edge length ratio is a fraction of the difference between the longest and shortest edge lengths in the Delaunay Triangulation of the area between the input polygons. (Roughly speaking, it is a fraction of the difference between the shortest and longest distances between the input polygons.) It is a value in the range 0 to 1.
- The value 0.0 produces the original input polygons.
- The value 1.0 produces the convex hull.
Declaration
public double MaximumEdgeLengthRatio { get; set; }Property Value
| Type | Description | 
|---|---|
| double | 
Tight
Gets or sets a flag indicating whether the boundary of the hull polygon is kept tight to the outer edges of the input polygons.
Declaration
public bool Tight { get; set; }Property Value
| Type | Description | 
|---|---|
| bool | 
Methods
| Edit this page View SourceConcaveFillByLength(Geometry, double)
Computes a concave fill area between a set of polygons, using the target criterion of maximum edge length.
Declaration
public static Geometry ConcaveFillByLength(Geometry polygons, double maxLength)Parameters
| Type | Name | Description | 
|---|---|---|
| Geometry | polygons | The input polygons | 
| double | maxLength | The target maximum edge length | 
Returns
| Type | Description | 
|---|---|
| Geometry | The concave fill | 
ConcaveFillByLengthRatio(Geometry, double)
Computes a concave fill area between a set of polygons, using the target criterion of maximum edge length ratio.
Declaration
public static Geometry ConcaveFillByLengthRatio(Geometry polygons, double lengthRatio)Parameters
| Type | Name | Description | 
|---|---|---|
| Geometry | polygons | The input polygons | 
| double | lengthRatio | The target maximum edge length ratio | 
Returns
| Type | Description | 
|---|---|
| Geometry | The concave fill | 
ConcaveHullByLength(Geometry, double)
Computes a concave hull of set of polygons using the target criterion of maximum edge length.
Declaration
public static Geometry ConcaveHullByLength(Geometry polygons, double maxLength)Parameters
| Type | Name | Description | 
|---|---|---|
| Geometry | polygons | The input polygons | 
| double | maxLength | The target maximum edge length | 
Returns
| Type | Description | 
|---|---|
| Geometry | The concave hull | 
ConcaveHullByLength(Geometry, double, bool, bool)
Computes a concave hull of set of polygons using the target criterion of maximum edge length, and allowing control over whether the hull boundary is tight and can contain holes.
Declaration
public static Geometry ConcaveHullByLength(Geometry polygons, double maxLength, bool isTight, bool isHolesAllowed)Parameters
| Type | Name | Description | 
|---|---|---|
| Geometry | polygons | The input polygons | 
| double | maxLength | The target maximum edge length | 
| bool | isTight | A flag indicating if the hull should be tight to the outside of the polygons | 
| bool | isHolesAllowed | A flag indicating if holes are allowed in the hull polygon | 
Returns
| Type | Description | 
|---|---|
| Geometry | The concave hull | 
ConcaveHullByLengthRatio(Geometry, double)
Computes a concave hull of set of polygons using the target criterion of maximum edge length ratio.
Declaration
public static Geometry ConcaveHullByLengthRatio(Geometry polygons, double lengthRatio)Parameters
| Type | Name | Description | 
|---|---|---|
| Geometry | polygons | The input polygons | 
| double | lengthRatio | The target maximum edge length ratio | 
Returns
| Type | Description | 
|---|---|
| Geometry | 
ConcaveHullByLengthRatio(Geometry, double, bool, bool)
Computes a concave hull of set of polygons using the target criterion of maximum edge length ratio, and allowing control over whether the hull boundary is tight and can contain holes.
Declaration
public static Geometry ConcaveHullByLengthRatio(Geometry polygons, double lengthRatio, bool isTight, bool isHolesAllowed)Parameters
| Type | Name | Description | 
|---|---|---|
| Geometry | polygons | The input polygons | 
| double | lengthRatio | The target maximum edge length ratio | 
| bool | isTight | A flag indicating if the hull should be tight to the outside of the polygons | 
| bool | isHolesAllowed | A flag indicating if holes are allowed in the hull polygon | 
Returns
| Type | Description | 
|---|---|
| Geometry | The concave hull | 
GetFill()
Gets the concave fill, which is the area between the input polygons, subject to the concaveness control parameter.
Declaration
public Geometry GetFill()Returns
| Type | Description | 
|---|---|
| Geometry | The concave fill | 
GetHull()
Gets the computed concave hull.
Declaration
public Geometry GetHull()Returns
| Type | Description | 
|---|---|
| Geometry | The concave hull |