Table of Contents

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

nodeFact NodeFactory

A factory to create Nodes

Fields

edgeEndList

protected IList<EdgeEnd> edgeEndList

Field Value

IList<EdgeEnd>

Properties

EdgeEnds

public IList<EdgeEnd> EdgeEnds { get; }

Property Value

IList<EdgeEnd>

Edges

protected IList<Edge> Edges { get; }

Property Value

IList<Edge>

NodeMap

protected NodeMap NodeMap { get; }

Property Value

NodeMap

Nodes

public IList<Node> Nodes { get; }

Property Value

IList<Node>

Methods

Add(EdgeEnd)

public void Add(EdgeEnd e)

Parameters

e EdgeEnd

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

edgesToAdd IList<Edge>

A set of Edges to add.

AddNode(Coordinate)

public Node AddNode(Coordinate coord)

Parameters

coord Coordinate

Returns

Node

AddNode(Node)

public Node AddNode(Node node)

Parameters

node Node

Returns

Node

Find(Coordinate)

Searches for a Node at Coordinate position coord

public Node Find(Coordinate coord)

Parameters

coord Coordinate

A Coordinate position

Returns

Node

The node if found; null otherwise

FindEdge(Coordinate, Coordinate)

Returns the edge whose first two coordinates are p0 and p1.

public Edge FindEdge(Coordinate p0, Coordinate p1)

Parameters

p0 Coordinate

The 1st Coordinate

p1 Coordinate

The 2nd Coordinate

Returns

Edge

The edge, if found null if 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

e Edge

An Edge

Returns

EdgeEnd

The edge, if found null if 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

p0 Coordinate

Starting Coordinate

p1 Coordinate

Coordinate used to establish direction

Returns

Edge

The matching edge, if found null if the edge was not found.

GetEdgeEnumerator()

public IEnumerator<Edge> GetEdgeEnumerator()

Returns

IEnumerator<Edge>

GetNodeEnumerator()

public IEnumerator<Node> GetNodeEnumerator()

Returns

IEnumerator<Node>

InsertEdge(Edge)

protected void InsertEdge(Edge e)

Parameters

e Edge

IsBoundaryNode(int, Coordinate)

public bool IsBoundaryNode(int geomIndex, Coordinate coord)

Parameters

geomIndex int
coord Coordinate

Returns

bool

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

nodes IList<Node>

A collection of Nodes

WriteEdges(StreamWriter)

public void WriteEdges(StreamWriter outstream)

Parameters

outstream StreamWriter