Search Results for

    Show / Hide Table of Contents

    Class LineSequencer

    Builds a sequence from a set of LineStrings, so that they are ordered end to end. A sequence is a complete non-repeating list of the linear components of the input. Each linestring is oriented so that identical endpoints are adjacent in the list.

    The input linestrings may form one or more connected sets. The input linestrings should be correctly noded, or the results may not be what is expected. The output of this method is a single MultiLineString, containing the ordered linestrings in the sequence.

    The sequencing employs the classic 'Eulerian path' graph algorithm. Since Eulerian paths are not uniquely determined, further rules are used to make the computed sequence preserve as much as possible of the input ordering. Within a connected subset of lines, the ordering rules are: - If there is degree-1 node which is the start node of an linestring, use that node as the start of the sequence. - If there is a degree-1 node which is the end node of an linestring, use that node as the end of the sequence. - If the sequence has no degree-1 nodes, use any node as the start

    Not all arrangements of lines can be sequenced. For a connected set of edges in a graph, Euler's Theorem states that there is a sequence containing each edge once if and only if there are no more than 2 nodes of odd degree. If it is not possible to find a sequence, the IsSequenceable() property will return false.

    Inheritance
    object
    LineSequencer
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: NetTopologySuite.Operation.Linemerge
    Assembly: NetTopologySuite.dll
    Syntax
    public class LineSequencer

    Methods

    | Edit this page View Source

    Add(Geometry)

    Adds a Geometry to be sequenced. May be called multiple times. Any dimension of Geometry may be added; the constituent linework will be extracted.

    Declaration
    public void Add(Geometry geometry)
    Parameters
    Type Name Description
    Geometry geometry
    | Edit this page View Source

    Add(IEnumerable<Geometry>)

    Adds a IEnumerable<T> of Geometrys to be sequenced. May be called multiple times. Any dimension of Geometry may be added; the constituent linework will be extracted.

    Declaration
    public void Add(IEnumerable<Geometry> geometries)
    Parameters
    Type Name Description
    IEnumerable<Geometry> geometries

    A IEnumerable<T> of geometries to add.

    | Edit this page View Source

    GetSequencedLineStrings()

    Returns the LineString or MultiLineString built by the sequencing process, if one exists.

    Declaration
    public Geometry GetSequencedLineStrings()
    Returns
    Type Description
    Geometry

    The sequenced linestrings, or null if a valid sequence does not exist.

    | Edit this page View Source

    IsSequenceable()

    Tests whether the arrangement of linestrings has a valid sequence.

    Declaration
    public bool IsSequenceable()
    Returns
    Type Description
    bool

    true if a valid sequence exists.

    | Edit this page View Source

    IsSequenced(Geometry)

    Tests whether a Geometry is sequenced correctly. LineStrings are trivially sequenced. MultiLineStrings are checked for correct sequencing. Otherwise, IsSequenced is defined to be true for geometries that are not lineal.

    Declaration
    public static bool IsSequenced(Geometry geom)
    Parameters
    Type Name Description
    Geometry geom

    The Geometry to test.

    Returns
    Type Description
    bool

    true if the Geometry is sequenced or is not lineal.

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