Class EdgeRing

Hierarchy: Object , EdgeRing
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.

Other

  • version: 1.7
public EdgeRing(GeometryFactory factory)
public static EdgeRing findEdgeRingContaining(EdgeRing testEr, List erList)
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 iff 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).

Returns:
containing EdgeRing, if there is one or null if no containing EdgeRing is found
public static List findDirEdgesInRing(PolygonizeDirectedEdge startDE)
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.
Parameters:
startDE - startDE the DirectedEdge to start traversing at
Returns:
a List of DirectedEdges that form a ring
public void build(PolygonizeDirectedEdge startDE)
public boolean isHole()
Tests whether this ring is a hole.
Returns:
true if this ring is a hole
public void 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 addHole(LinearRing hole)
Adds a hole to the polygon formed by this ring.
Parameters:
hole - hole the LinearRing forming the hole.
public void addHole(EdgeRing holeER)
Adds a hole to the polygon formed by this ring.
Parameters:
hole - hole the LinearRing forming the hole.
public Polygon getPolygon()
Computes the Polygon formed by this ring and any contained holes.
Returns:
the Polygon formed by this ring and its holes.
public boolean isValid()
Tests if the LinearRing ring formed by this edge ring is topologically valid.
Returns:
true if the ring is valid
public boolean isIncludedSet()
public boolean isIncluded()
public void setIncluded(boolean isIncluded)
public boolean isInRing(Coordinate pt)
public LineString getLineString()
Gets the coordinates for this ring as a LineString. Used to return the coordinates in this ring as a valid geometry, when it has been detected that the ring is topologically invalid.
Returns:
a LineString containing the coordinates in this ring
public LinearRing getRing()
Returns this ring as a LinearRing, or null if an Exception occurs while creating it (such as a topology problem). Details of problems are written to standard output.
public void setShell(EdgeRing shell)
Sets the containing shell ring of a ring that has been determined to be a hole.
Parameters:
shell - shell the shell ring
public boolean hasShell()
Tests whether this ring has a shell assigned to it.
Returns:
true if the ring has a shell
public EdgeRing getShell()
Gets the shell for this ring. The shell is the ring itself if it is not a hole, otherwise its parent shell.
Returns:
the shell for this ring
public boolean isOuterHole()
Tests whether this ring is an outer hole. A hole is an outer hole if it is not contained by a shell.
Returns:
true if the ring is an outer hole.
public boolean isOuterShell()
Tests whether this ring is an outer shell.
Returns:
true if the ring is an outer shell.
public EdgeRing getOuterHole()
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.
Returns:
the outer hole edge ring, or null
public void updateIncluded()
Updates the included status for currently non-included shells based on whether they are adjacent to an included shell.
public String toString()
Gets a string representation of this object.
Returns:
a string representing the object
public boolean isProcessed()
Returns:
whether the ring has been processed
public void setProcessed(boolean isProcessed)
Parameters:
isProcessed - isProcessed whether the ring has been processed