Search Results for

    Show / Hide Table of Contents

    Class EdgeGraph

    A graph comprised of HalfEdges. It supports tracking the vertices in the graph via edges incident on them, to allow efficient lookup of edges and vertices.

    Inheritance
    object
    EdgeGraph
    DissolveEdgeGraph
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: NetTopologySuite.EdgeGraph
    Assembly: NetTopologySuite.dll
    Syntax
    public class EdgeGraph
    Remarks

    This class may be subclassed to use a different subclass of HalfEdge, by overriding CreateEdge(Coordinate). If additional logic is required to initialize edges then AddEdge(Coordinate, Coordinate) can be overridden as well.

    Methods

    | Edit this page View Source

    AddEdge(Coordinate, Coordinate)

    Adds an edge between the coordinates orig and dest to this graph.

    Declaration
    public virtual HalfEdge AddEdge(Coordinate orig, Coordinate dest)
    Parameters
    Type Name Description
    Coordinate orig

    the edge origin location

    Coordinate dest

    the edge destination location

    Returns
    Type Description
    HalfEdge

    The created edge

    Remarks

    Only valid edges can be added (in particular, zero-length segments cannot be added)

    See Also
    IsValidEdge(Coordinate, Coordinate)
    | Edit this page View Source

    CreateEdge(Coordinate)

    Creates a single HalfEdge. Override to use a different HalfEdge subclass.

    Declaration
    protected virtual HalfEdge CreateEdge(Coordinate orig)
    Parameters
    Type Name Description
    Coordinate orig

    the origin location

    Returns
    Type Description
    HalfEdge

    a new HalfEdge with the given origin

    | Edit this page View Source

    FindEdge(Coordinate, Coordinate)

    Finds an edge in this graph with the given origin and destination, if one exists.

    Declaration
    public HalfEdge FindEdge(Coordinate orig, Coordinate dest)
    Parameters
    Type Name Description
    Coordinate orig

    the origin location

    Coordinate dest

    the destination location

    Returns
    Type Description
    HalfEdge

    an edge with the given orig and dest, or null if none exists

    | Edit this page View Source

    GetVertexEdges()

    Gets all HalfEdges in the graph. Both edges of edge pairs are included.

    Declaration
    public IEnumerable<HalfEdge> GetVertexEdges()
    Returns
    Type Description
    IEnumerable<HalfEdge>

    An enumeration of the graph edges

    | Edit this page View Source

    IsValidEdge(Coordinate, Coordinate)

    Test if an the coordinates for an edge form a valid edge (with non-zero length)

    Declaration
    public static bool IsValidEdge(Coordinate orig, Coordinate dest)
    Parameters
    Type Name Description
    Coordinate orig

    The start coordinate

    Coordinate dest

    The end coordinate

    Returns
    Type Description
    bool

    true of the edge formed is valid

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX