public class EdgeRing
extends java.lang.Object
PolygonizeDirectedEdge
s which form
a ring of a polygon. The ring may be either an outer shell or a hole.Constructor and Description |
---|
EdgeRing(GeometryFactory factory) |
Modifier and Type | Method and Description |
---|---|
void |
add(DirectedEdge de)
Adds a
DirectedEdge which is known to form part of this ring. |
void |
addHole(LinearRing hole)
Adds a hole to the polygon formed by this ring.
|
static EdgeRing |
findEdgeRingContaining(EdgeRing testEr,
java.util.List shellList)
Find the innermost enclosing shell EdgeRing containing the argument EdgeRing, if any.
|
LineString |
getLineString()
Gets the coordinates for this ring as a
LineString . |
Polygon |
getPolygon()
Computes the
Polygon formed by this ring and any contained holes. |
LinearRing |
getRing()
Returns this ring as a
LinearRing , or null if an Exception occurs while
creating it (such as a topology problem). |
boolean |
isHole()
Tests whether this ring is a hole.
|
static boolean |
isInList(Coordinate pt,
Coordinate[] pts)
Tests whether a given point is in an array of points.
|
boolean |
isValid()
Tests if the
LinearRing ring formed by this edge ring is topologically valid. |
static Coordinate |
ptNotInList(Coordinate[] testPts,
Coordinate[] pts)
Finds a point in a list of points which is not contained in another list of points
|
public EdgeRing(GeometryFactory factory)
public static EdgeRing findEdgeRingContaining(EdgeRing testEr, java.util.List shellList)
public static Coordinate ptNotInList(Coordinate[] testPts, Coordinate[] pts)
testPts
- the Coordinate
s to testpts
- an array of Coordinate
s to test the input points againstCoordinate
from testPts
which is not in pts
,public static boolean isInList(Coordinate pt, Coordinate[] pts)
pt
- a Coordinate
for the test pointpts
- an array of Coordinate
s to testtrue
if the point is in the arraypublic void add(DirectedEdge de)
DirectedEdge
which is known to form part of this ring.de
- the DirectedEdge
to add.public boolean isHole()
true
if this ring is a holepublic void addHole(LinearRing hole)
hole
- the LinearRing
forming the hole.public Polygon getPolygon()
Polygon
formed by this ring and any contained holes.Polygon
formed by this ring and its holes.public boolean isValid()
LinearRing
ring formed by this edge ring is topologically valid.public LineString getLineString()
LineString
.
Used to return the coordinates in this ring
as a valid geometry, when it has been detected that the ring is topologically
invalid.LineString
containing the coordinates in this ringpublic LinearRing getRing()
LinearRing
, or null if an Exception occurs while
creating it (such as a topology problem). Details of problems are written to
standard output.