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, Geometry
s 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
|
Improve this Doc
View Source
PlanarGraph()
Creates an instance of this class using the default NodeFactory.
Declaration
|
Improve this Doc
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 Node s
|
Fields
|
Improve this Doc
View Source
edgeEndList
Declaration
protected IList<EdgeEnd> edgeEndList
Field Value
Properties
|
Improve this Doc
View Source
EdgeEnds
Declaration
public IList<EdgeEnd> EdgeEnds { get; }
Property Value
|
Improve this Doc
View Source
Edges
Declaration
protected IList<Edge> Edges { get; }
Property Value
|
Improve this Doc
View Source
NodeMap
Declaration
protected NodeMap NodeMap { get; }
Property Value
|
Improve this Doc
View Source
Nodes
Declaration
public IList<Node> Nodes { get; }
Property Value
Methods
|
Improve this Doc
View Source
Add(EdgeEnd)
Declaration
public void Add(EdgeEnd e)
Parameters
|
Improve this Doc
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 Edge s to add.
|
|
Improve this Doc
View Source
AddNode(Coordinate)
Declaration
public Node AddNode(Coordinate coord)
Parameters
Returns
|
Improve this Doc
View Source
AddNode(Node)
Declaration
public Node AddNode(Node node)
Parameters
Type |
Name |
Description |
Node |
node |
|
Returns
|
Improve this Doc
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
|
|
Improve this Doc
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.
|
|
Improve this Doc
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.
|
|
Improve this Doc
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.
|
|
Improve this Doc
View Source
GetEdgeEnumerator()
Declaration
public IEnumerator<Edge> GetEdgeEnumerator()
Returns
|
Improve this Doc
View Source
GetNodeEnumerator()
Declaration
public IEnumerator<Node> GetNodeEnumerator()
Returns
|
Improve this Doc
View Source
InsertEdge(Edge)
Declaration
protected void InsertEdge(Edge e)
Parameters
Type |
Name |
Description |
Edge |
e |
|
|
Improve this Doc
View Source
IsBoundaryNode(Int32, Coordinate)
Declaration
public bool IsBoundaryNode(int geomIndex, Coordinate coord)
Parameters
Returns
|
Improve this Doc
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()
|
Improve this Doc
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()
|
Improve this Doc
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 Node s
|
|
Improve this Doc
View Source
WriteEdges(StreamWriter)
Declaration
public void WriteEdges(StreamWriter outstream)
Parameters