Class EdgeRing
- Namespace
- NetTopologySuite.Operation.Polygonize
- Assembly
- NetTopologySuite.dll
Represents a ring of PolygonizeDirectedEdges which form a ring of a polygon. The ring may be either an outer shell or a hole.
public class EdgeRing
- Inheritance
-
EdgeRing
- Inherited Members
Constructors
EdgeRing(GeometryFactory)
public EdgeRing(GeometryFactory factory)
Parameters
factory
GeometryFactory
Properties
HasShell
Gets a value indicating whether this ring has a shell assigned to it.
public bool HasShell { get; }
Property Value
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.
public bool IsHole { get; }
Property Value
- bool
true
if this ring is a hole.
IsIncluded
public bool IsIncluded { get; set; }
Property Value
IsIncludedSet
public bool IsIncludedSet { get; }
Property Value
IsOuterHole
Tests whether this ring is an outer hole. A hole is an outer hole if it is not contained by a shell.
public bool IsOuterHole { get; }
Property Value
IsOuterShell
Tests whether this ring is an outer shell.
public bool IsOuterShell { get; }
Property Value
IsProcessed
Gets or sets a value indicating whether this ring has been processed.
public bool IsProcessed { get; set; }
Property Value
IsValid
Tests if the LinearRing ring formed by this edge ring is topologically valid.
public bool IsValid { get; }
Property Value
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.
public LineString LineString { get; }
Property Value
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.
public EdgeRing OuterHole { get; }
Property Value
- EdgeRing
The outer hole edge ring, or
null
Polygon
Computes and returns the Polygon formed by this ring and any contained holes.
public Polygon Polygon { get; }
Property Value
Ring
Returns this ring as a LinearRing, or null if an Exception occurs while creating it (such as a topology problem).
public LinearRing Ring { get; }
Property Value
Shell
Gets or sets a value indicating the containing shell ring of a ring that has been determined to be a hole.
public EdgeRing Shell { get; }
Property Value
Methods
AddHole(LinearRing)
Adds a hole to the polygon formed by this ring.
public void AddHole(LinearRing hole)
Parameters
hole
LinearRingThe LinearRing forming the hole.
AddHole(EdgeRing)
Adds a hole to the polygon formed by this ring.
public void AddHole(EdgeRing holeER)
Parameters
holeER
EdgeRingthe LinearRing forming the hole.
Build(PolygonizeDirectedEdge)
public void Build(PolygonizeDirectedEdge startDE)
Parameters
startDE
PolygonizeDirectedEdge
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.
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.
public static List<DirectedEdge> FindDirEdgesInRing(PolygonizeDirectedEdge startDE)
Parameters
startDE
PolygonizeDirectedEdgeThe DirectedEdge to start traversing at
Returns
- 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).public static EdgeRing FindEdgeRingContaining(EdgeRing testEr, IList<EdgeRing> erList)
Parameters
Returns
- EdgeRing
Containing EdgeRing, if there is one
ornull
if no containing EdgeRing is found.
IsInRing(Coordinate)
public bool IsInRing(Coordinate pt)
Parameters
pt
Coordinate
Returns
ToString()
Gets a string representation of this object.
public override string ToString()