Class PlanarGraph
- Namespace
- NetTopologySuite.GeometriesGraph
- Assembly
- NetTopologySuite.dll
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
public class PlanarGraph
- Inheritance
-
PlanarGraph
- Derived
- Inherited Members
Constructors
PlanarGraph()
Creates an instance of this class using the default NodeFactory.
public PlanarGraph()
PlanarGraph(NodeFactory)
Creates an instance of this class using the provided NodeFactory
public PlanarGraph(NodeFactory nodeFact)
Parameters
nodeFactNodeFactoryA factory to create
Nodes
Fields
edgeEndList
protected IList<EdgeEnd> edgeEndList
Field Value
Properties
EdgeEnds
public IList<EdgeEnd> EdgeEnds { get; }
Property Value
Edges
protected IList<Edge> Edges { get; }
Property Value
NodeMap
protected NodeMap NodeMap { get; }
Property Value
Nodes
public IList<Node> Nodes { get; }
Property Value
Methods
Add(EdgeEnd)
public void Add(EdgeEnd e)
Parameters
eEdgeEnd
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.
public void AddEdges(IList<Edge> edgesToAdd)
Parameters
AddNode(Coordinate)
public Node AddNode(Coordinate coord)
Parameters
coordCoordinate
Returns
AddNode(Node)
public Node AddNode(Node node)
Parameters
nodeNode
Returns
Find(Coordinate)
Searches for a Node at Coordinate position coord
public Node Find(Coordinate coord)
Parameters
coordCoordinateA
Coordinateposition
Returns
- Node
The node if found;
nullotherwise
FindEdge(Coordinate, Coordinate)
Returns the edge whose first two coordinates are p0 and p1.
public Edge FindEdge(Coordinate p0, Coordinate p1)
Parameters
p0CoordinateThe 1st
Coordinatep1CoordinateThe 2nd
Coordinate
Returns
- Edge
The edge, if found
nullif the edge was not found.
FindEdgeEnd(Edge)
Returns the EdgeEnd which has edge e as its base edge (MD 18 Feb 2002 - this should return a pair of edges).
public EdgeEnd FindEdgeEnd(Edge e)
Parameters
eEdgeAn
Edge
Returns
- EdgeEnd
The edge, if found
nullif the edge was not found.
FindEdgeInSameDirection(Coordinate, Coordinate)
Returns the edge which starts at p0 and whose first segment is parallel to p1.
public Edge FindEdgeInSameDirection(Coordinate p0, Coordinate p1)
Parameters
p0CoordinateStarting
Coordinatep1CoordinateCoordinateused to establish direction
Returns
- Edge
The matching edge, if found
nullif the edge was not found.
GetEdgeEnumerator()
public IEnumerator<Edge> GetEdgeEnumerator()
Returns
GetNodeEnumerator()
public IEnumerator<Node> GetNodeEnumerator()
Returns
InsertEdge(Edge)
protected void InsertEdge(Edge e)
Parameters
eEdge
IsBoundaryNode(int, Coordinate)
public bool IsBoundaryNode(int geomIndex, Coordinate coord)
Parameters
geomIndexintcoordCoordinate
Returns
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).
public void LinkAllDirectedEdges()
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).
public void LinkResultDirectedEdges()
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).
public static void LinkResultDirectedEdges(IList<Node> nodes)
Parameters
WriteEdges(StreamWriter)
public void WriteEdges(StreamWriter outstream)
Parameters
outstreamStreamWriter