public class PlanarGraph extends Object
IntersectionMatrix relies on the use of a structure called a "topology graph". The topology graph contains nodes and edges corresponding to the nodes and line segments of a
Geometry. Each node and edge in the graph is labeled with its topological location relative to the source geometry.
Note that there is no requirement that points of self-intersection be a vertex. Thus to obtain a correct topology graph, Geometrys must be self-noded before constructing their graphs.
Two fundamental operations are supported by topology graphs:
| Modifier and Type | Field and Description |
|---|---|
protected List |
edgeEndList
|
protected List |
edges
|
protected NodeMap |
nodes
|
| Constructor and Description |
|---|
PlanarGraph()
|
PlanarGraph(NodeFactory
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(EdgeEnd
|
void |
addEdges(List
Add a set of edges to the graph.
|
Node |
addNode(Coordinate
|
Node |
addNode(Node
|
Node |
find(Coordinate
|
Edge |
findEdge(Coordinate
Returns the edge whose first two coordinates are p0 and p1
|
EdgeEnd |
findEdgeEnd(Edge
Returns the EdgeEnd which has edge e as its base edge (MD 18 Feb 2002 - this should return a pair of edges)
|
Edge |
findEdgeInSameDirection(Coordinate
Returns the edge which starts at p0 and whose first segment is parallel to p1
|
Collection |
getEdgeEnds()
|
Iterator |
getEdgeIterator()
|
Iterator |
getNodeIterator()
|
Collection |
getNodes()
|
protected void |
insertEdge(Edge
|
boolean |
isBoundaryNode(int geomIndex, Coordinate
|
void |
linkAllDirectedEdges()
Link the DirectedEdges at the nodes of the graph.
|
void |
linkResultDirectedEdges()
Link the DirectedEdges at the nodes of the graph.
|
static void |
linkResultDirectedEdges(Collection
For nodes in the Collection, link the DirectedEdges at the node that are in the result.
|
void |
printEdges(PrintStream
|
protected Listedges
protected NodeMapnodes
protected ListedgeEndList
public PlanarGraph(NodeFactorynodeFact)
public PlanarGraph()
public static void linkResultDirectedEdges(Collectionnodes)
public IteratorgetEdgeIterator()
public CollectiongetEdgeEnds()
public boolean isBoundaryNode(int geomIndex,
Coordinate coord) protected void insertEdge(Edgee)
public void add(EdgeEnde)
public IteratorgetNodeIterator()
public CollectiongetNodes()
public NodeaddNode(Coordinate coord)
public Nodefind(Coordinate coord)
public void addEdges(ListedgesToAdd)
public void linkResultDirectedEdges()
public void linkAllDirectedEdges()
public EdgeEndfindEdgeEnd(Edge e)
null if the edge was not found
public EdgefindEdge(Coordinate p0, Coordinate p1)
null if the edge was not found
public EdgefindEdgeInSameDirection(Coordinate p0, Coordinate p1)
null if the edge was not found
public void printEdges(PrintStreamout)