Class EdgeRing
Represents a ring of PolygonizeDirectedEdges which form a ring of a polygon. The ring may be either an outer shell or a hole.
Inherited Members
Namespace: NetTopologySuite.Operation.Polygonize
Assembly: NetTopologySuite.dll
Syntax
public class EdgeRing
Constructors
| Improve this Doc View SourceEdgeRing(GeometryFactory)
Declaration
public EdgeRing(GeometryFactory factory)
Parameters
Type | Name | Description |
---|---|---|
GeometryFactory | factory |
Properties
| Improve this Doc View SourceHasShell
Gets a value indicating whether this ring has a shell assigned to it.
Declaration
public bool HasShell { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsHole
Tests whether this ring is a hole. Due to the way the edges in the polygonization graph are linked, a ring is a hole if it is oriented counter-clockwise.
Declaration
public bool IsHole { get; }
Property Value
Type | Description |
---|---|
Boolean |
|
IsIncluded
Declaration
public bool IsIncluded { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
IsIncludedSet
Declaration
public bool IsIncludedSet { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsOuterHole
Tests whether this ring is an outer hole. A hole is an outer hole if it is not contained by a shell.
Declaration
public bool IsOuterHole { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsOuterShell
Tests whether this ring is an outer shell.
Declaration
public bool IsOuterShell { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsProcessed
Gets or sets a value indicating whether this ring has been processed.
Declaration
public bool IsProcessed { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
IsValid
Tests if the LinearRing ring formed by this edge ring is topologically valid.
Declaration
public bool IsValid { get; }
Property Value
Type | Description |
---|---|
Boolean |
LineString
Gets the coordinates for this ring as a LineString
.
Used to return the coordinates in this ring
as a valid point, when it has been detected that the ring is topologically
invalid.
Declaration
public LineString LineString { get; }
Property Value
Type | Description |
---|---|
LineString |
OuterHole
Gets the outer hole of a shell, if it has one. An outer hole is one that is not contained in any other shell. Each disjoint connected group of shells is surrounded by an outer hole.
Declaration
public EdgeRing OuterHole { get; }
Property Value
Type | Description |
---|---|
EdgeRing | The outer hole edge ring, or |
Polygon
Computes and returns the Polygon formed by this ring and any contained holes.
Declaration
public Polygon Polygon { get; }
Property Value
Type | Description |
---|---|
Polygon |
Ring
Returns this ring as a LinearRing, or null if an Exception occurs while creating it (such as a topology problem).
Declaration
public LinearRing Ring { get; }
Property Value
Type | Description |
---|---|
LinearRing |
Shell
Gets or sets a value indicating the containing shell ring of a ring that has been determined to be a hole.
Declaration
public EdgeRing Shell { get; }
Property Value
Type | Description |
---|---|
EdgeRing |
Methods
| Improve this Doc View SourceAddHole(LinearRing)
Adds a hole to the polygon formed by this ring.
Declaration
public void AddHole(LinearRing hole)
Parameters
Type | Name | Description |
---|---|---|
LinearRing | hole | The LinearRing forming the hole. |
AddHole(EdgeRing)
Adds a hole to the polygon formed by this ring.
Declaration
public void AddHole(EdgeRing holeER)
Parameters
Type | Name | Description |
---|---|---|
EdgeRing | holeER | the LinearRing forming the hole. |
Build(PolygonizeDirectedEdge)
Declaration
public void Build(PolygonizeDirectedEdge startDE)
Parameters
Type | Name | Description |
---|---|---|
PolygonizeDirectedEdge | startDE |
ComputeHole()
Computes whether this ring is a hole. Due to the way the edges in the polygonization graph are linked, a ring is a hole if it is oriented counter-clockwise.
Declaration
public void ComputeHole()
FindDirEdgesInRing(PolygonizeDirectedEdge)
Traverses a ring of DirectedEdges, accumulating them into a list. This assumes that all dangling directed edges have been removed from the graph, so that there is always a next dirEdge.
Declaration
public static List<DirectedEdge> FindDirEdgesInRing(PolygonizeDirectedEdge startDE)
Parameters
Type | Name | Description |
---|---|---|
PolygonizeDirectedEdge | startDE | The DirectedEdge to start traversing at |
Returns
Type | Description |
---|---|
List<DirectedEdge> | A list of DirectedEdges that form a ring |
FindEdgeRingContaining(EdgeRing, IList<EdgeRing>)
Find the innermost enclosing shell EdgeRing containing the argument EdgeRing, if any. The innermost enclosing ring is the smallest enclosing ring. The algorithm used depends on the fact that: ring A contains ring B if envelope(ring A) contains envelope(ring B). This routine is only safe to use if the chosen point of the hole is known to be properly contained in a shell (which is guaranteed to be the case if the hole does not touch its shell).
To improve performance of this function the caller should make the passed shellList as small as possible(e.g. by using a spatial index filter beforehand).
Declaration
public static EdgeRing FindEdgeRingContaining(EdgeRing testEr, IList<EdgeRing> erList)
Parameters
Type | Name | Description |
---|---|---|
EdgeRing | testEr | |
IList<EdgeRing> | erList |
Returns
Type | Description |
---|---|
EdgeRing | Containing EdgeRing, if there is one |
IsInRing(Coordinate)
Declaration
public bool IsInRing(Coordinate pt)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | pt |
Returns
Type | Description |
---|---|
Boolean |
ToString()
Gets a string representation of this object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |