Class PolygonHoleJoiner
Transforms a polygon with holes into a single self-touching (invalid) ring by joining holes to the exterior shell or to another hole with out-and-back line segments. The holes are added in order of their envelopes (leftmost/lowest first). As the result shell develops, a hole may be added to what was originally another hole.
There is no attempt to optimize the quality of the join lines. In particular, holes may be joined by lines longer than is optimal. However, holes which touch the shell or other holes are joined at the touch point. The class does not require the input polygon to have normal orientation (shell CW and rings CCW). The output ring is always CW.Inherited Members
Namespace: NetTopologySuite.Triangulate.Polygon
Assembly: NetTopologySuite.dll
Syntax
public class PolygonHoleJoiner
Constructors
| Edit this page View SourcePolygonHoleJoiner(Polygon)
Creates a new hole joiner.
Declaration
public PolygonHoleJoiner(Polygon polygon)
Parameters
Type | Name | Description |
---|---|---|
Polygon | polygon | The polygon to join |
Methods
| Edit this page View SourceCompute()
Computes the joined ring
Declaration
public Coordinate[] Compute()
Returns
Type | Description |
---|---|
Coordinate[] | The points in the joined ring |
Join(Polygon)
Joins the shell and holes of a polygon and returns the result as sequence of Coordinates.
Declaration
public static Coordinate[] Join(Polygon polygon)
Parameters
Type | Name | Description |
---|---|---|
Polygon | polygon | The polygon to join |
Returns
Type | Description |
---|---|
Coordinate[] | The result coordinates |
JoinAsPolygon(Polygon)
Joins the shell and holes of a polygon and returns the result as an (invalid) Polygon.
Declaration
public static Polygon JoinAsPolygon(Polygon polygon)
Parameters
Type | Name | Description |
---|---|---|
Polygon | polygon | The polygon to join |
Returns
Type | Description |
---|---|
Polygon | The result polygon |