Class PolygonizeGraph

Hierarchy: Object , PlanarGraph, PolygonizeGraph
class PolygonizeGraph
extends PlanarGraph
Represents a planar graph of edges that can be used to compute a polygonization, and implements the algorithms to compute the EdgeRings formed by the graph.

The marked flag on DirectedEdges is used to indicate that a directed edge has be logically deleted from the graph.

Other

  • version: 1.7
public PolygonizeGraph(GeometryFactory factory)
Create a new polygonization graph.
public static void deleteAllEdges(Node node)
Deletes all edges at a node
public void addEdge(LineString line)
Add a LineString forming an edge of the polygon graph.
Parameters:
line - line the line to add
public List getEdgeRings()
Computes the minimal EdgeRings formed by the edges in this graph.
Returns:
a list of the EdgeRings found by the polygonization process.
public List deleteCutEdges()
Finds and removes all cut edges from the graph.
Returns:
a list of the LineStrings forming the removed cut edges
public Collection deleteDangles()
Marks all edges from the graph which are "dangles". Dangles are which are incident on a node with degree 1. This process is recursive, since removing a dangling edge may result in another edge becoming a dangle. In order to handle large recursion depths efficiently, an explicit recursion stack is used
Returns:
a List containing the LineStrings that formed dangles
public 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. If the client has requested that the output be polygonally valid, only odd polygons will be constructed.