class PolygonizeGraph extends PlanarGraph
EdgeRings
formed by the graph.
The marked flag on DirectedEdge
s is used to indicate that a directed edge
has be logically deleted from the graph.
Modifier and Type | Field and Description |
---|---|
private GeometryFactory |
factory |
dirEdges, edges, nodeMap
Constructor and Description |
---|
PolygonizeGraph(GeometryFactory factory)
Create a new polygonization graph.
|
Modifier and Type | Method and Description |
---|---|
void |
addEdge(LineString line)
Add a
LineString forming an edge of the polygon graph. |
void |
computeDepthParity()
Traverses the polygonized edge rings in the graph
and computes the depth parity (odd or even)
relative to the exterior of the graph.
|
private void |
computeDepthParity(PolygonizeDirectedEdge de)
Traverses all connected edges, computing the depth parity
of the associated polygons.
|
private static void |
computeNextCCWEdges(Node node,
long label)
Computes the next edge pointers going CCW around the given node, for the
given edgering label.
|
private void |
computeNextCWEdges() |
private static void |
computeNextCWEdges(Node node) |
private void |
convertMaximalToMinimalEdgeRings(java.util.List ringEdges)
Convert the maximal edge rings found by the initial graph traversal
into the minimal edge rings required by JTS polygon topology rules.
|
static void |
deleteAllEdges(Node node)
Deletes all edges at a node
|
java.util.List |
deleteCutEdges()
Finds and removes all cut edges from the graph.
|
java.util.Collection |
deleteDangles()
Marks all edges from the graph which are "dangles".
|
private EdgeRing |
findEdgeRing(PolygonizeDirectedEdge startDE) |
private static java.util.List |
findIntersectionNodes(PolygonizeDirectedEdge startDE,
long label)
Finds all nodes in a maximal edgering which are self-intersection nodes
|
private static java.util.List |
findLabeledEdgeRings(java.util.Collection dirEdges)
Finds and labels all edgerings in the graph.
|
private static int |
getDegree(Node node,
long label) |
private static int |
getDegreeNonDeleted(Node node) |
java.util.List |
getEdgeRings()
Computes the minimal EdgeRings formed by the edges in this graph.
|
private Node |
getNode(Coordinate pt) |
private static void |
label(java.util.Collection dirEdges,
long label) |
add, add, add, contains, contains, dirEdgeIterator, edgeIterator, findNode, findNodesOfDegree, getEdges, getNodes, nodeIterator, remove, remove, remove
private GeometryFactory factory
public PolygonizeGraph(GeometryFactory factory)
private static int getDegreeNonDeleted(Node node)
private static int getDegree(Node node, long label)
public static void deleteAllEdges(Node node)
public void addEdge(LineString line)
LineString
forming an edge of the polygon graph.line
- the line to addprivate Node getNode(Coordinate pt)
private void computeNextCWEdges()
private void convertMaximalToMinimalEdgeRings(java.util.List ringEdges)
ringEdges
- the list of start edges for the edgeRings to convert.private static java.util.List findIntersectionNodes(PolygonizeDirectedEdge startDE, long label)
startDE
- label
- null
if no intersection nodes were foundpublic java.util.List getEdgeRings()
EdgeRing
s found by the polygonization process.private static java.util.List findLabeledEdgeRings(java.util.Collection dirEdges)
dirEdges
- a List of the DirectedEdges in the graphpublic java.util.List deleteCutEdges()
LineString
s forming the removed cut edgesprivate static void label(java.util.Collection dirEdges, long label)
private static void computeNextCWEdges(Node node)
private static void computeNextCCWEdges(Node node, long label)
private EdgeRing findEdgeRing(PolygonizeDirectedEdge startDE)
public java.util.Collection deleteDangles()
LineString
s that formed danglespublic void computeDepthParity()
private void computeDepthParity(PolygonizeDirectedEdge de)
de
-