Class PlanarGraph
The computation of the 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 point.
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:
Computing the intersections between all the edges and nodes of a single graph
Computing the intersections between the edges and nodes of two different graphs
Assembly: NetTopologySuite.dll
Syntax
Constructors
|
Edit this page
View Source
PlanarGraph()
Creates an instance of this class using the default NodeFactory.
Declaration
|
Edit this page
View Source
PlanarGraph(NodeFactory)
Creates an instance of this class using the provided NodeFactory
Declaration
public PlanarGraph(NodeFactory nodeFact)
Parameters
| Type |
Name |
Description |
| NodeFactory |
nodeFact |
A factory to create Nodes
|
Fields
|
Edit this page
View Source
edgeEndList
Declaration
protected IList<EdgeEnd> edgeEndList
Field Value
Properties
|
Edit this page
View Source
EdgeEnds
Declaration
public IList<EdgeEnd> EdgeEnds { get; }
Property Value
|
Edit this page
View Source
Edges
Declaration
protected IList<Edge> Edges { get; }
Property Value
|
Edit this page
View Source
NodeMap
Declaration
protected NodeMap NodeMap { get; }
Property Value
|
Edit this page
View Source
Nodes
Declaration
public IList<Node> Nodes { get; }
Property Value
Methods
|
Edit this page
View Source
Add(EdgeEnd)
Declaration
public void Add(EdgeEnd e)
Parameters
|
Edit this page
View Source
AddEdges(IList<Edge>)
Add a set of edges to the graph. For each edge two DirectedEdges
will be created. DirectedEdges are NOT linked by this method.
Declaration
public void AddEdges(IList<Edge> edgesToAdd)
Parameters
| Type |
Name |
Description |
| IList<Edge> |
edgesToAdd |
A set of Edges to add.
|
|
Edit this page
View Source
AddNode(Coordinate)
Declaration
public Node AddNode(Coordinate coord)
Parameters
Returns
|
Edit this page
View Source
AddNode(Node)
Declaration
public Node AddNode(Node node)
Parameters
| Type |
Name |
Description |
| Node |
node |
|
Returns
|
Edit this page
View Source
Find(Coordinate)
Searches for a Node at Coordinate position coord
Declaration
public Node Find(Coordinate coord)
Parameters
| Type |
Name |
Description |
| Coordinate |
coord |
A Coordinate position
|
Returns
| Type |
Description |
| Node |
The node if found; null otherwise
|
|
Edit this page
View Source
FindEdge(Coordinate, Coordinate)
Returns the edge whose first two coordinates are p0 and p1.
Declaration
public Edge FindEdge(Coordinate p0, Coordinate p1)
Parameters
Returns
| Type |
Description |
| Edge |
The edge, if found null if the edge was not found.
|
|
Edit this page
View Source
FindEdgeEnd(Edge)
Returns the EdgeEnd which has edge e as its base edge
(MD 18 Feb 2002 - this should return a pair of edges).
Declaration
public EdgeEnd FindEdgeEnd(Edge e)
Parameters
| Type |
Name |
Description |
| Edge |
e |
An Edge
|
Returns
| Type |
Description |
| EdgeEnd |
The edge, if found null if the edge was not found.
|
|
Edit this page
View Source
FindEdgeInSameDirection(Coordinate, Coordinate)
Returns the edge which starts at p0 and whose first segment is
parallel to p1.
Declaration
public Edge FindEdgeInSameDirection(Coordinate p0, Coordinate p1)
Parameters
| Type |
Name |
Description |
| Coordinate |
p0 |
Starting Coordinate
|
| Coordinate |
p1 |
Coordinate used to establish direction
|
Returns
| Type |
Description |
| Edge |
The matching edge, if found null if the edge was not found.
|
|
Edit this page
View Source
GetEdgeEnumerator()
Declaration
public IEnumerator<Edge> GetEdgeEnumerator()
Returns
|
Edit this page
View Source
GetNodeEnumerator()
Declaration
public IEnumerator<Node> GetNodeEnumerator()
Returns
|
Edit this page
View Source
InsertEdge(Edge)
Declaration
protected void InsertEdge(Edge e)
Parameters
| Type |
Name |
Description |
| Edge |
e |
|
|
Edit this page
View Source
IsBoundaryNode(int, Coordinate)
Declaration
public bool IsBoundaryNode(int geomIndex, Coordinate coord)
Parameters
Returns
|
Edit this page
View Source
LinkAllDirectedEdges()
Link the DirectedEdges at the nodes of the graph.
This allows clients to link only a subset of nodes in the graph, for
efficiency (because they know that only a subset is of interest).
Declaration
public void LinkAllDirectedEdges()
|
Edit this page
View Source
LinkResultDirectedEdges()
Link the DirectedEdges at the nodes of the graph.
This allows clients to link only a subset of nodes in the graph, for
efficiency (because they know that only a subset is of interest).
Declaration
public void LinkResultDirectedEdges()
|
Edit this page
View Source
LinkResultDirectedEdges(IList<Node>)
For nodes in the Collection, link the DirectedEdges at the node that are in the result.
This allows clients to link only a subset of nodes in the graph, for
efficiency (because they know that only a subset is of interest).
Declaration
public static void LinkResultDirectedEdges(IList<Node> nodes)
Parameters
| Type |
Name |
Description |
| IList<Node> |
nodes |
A collection of Nodes
|
|
Edit this page
View Source
WriteEdges(StreamWriter)
Declaration
public void WriteEdges(StreamWriter outstream)
Parameters