Search Results for

    Show / Hide Table of Contents

    Class LocationIndexedLine

    Supports linear referencing along a linear Geometry using LinearLocations as the index.

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

    Constructors

    | Edit this page View Source

    LocationIndexedLine(Geometry)

    Constructs an object which allows linear referencing along a given linear Geometry.

    Declaration
    public LocationIndexedLine(Geometry linearGeom)
    Parameters
    Type Name Description
    Geometry linearGeom

    The linear geometry to reference alo

    Properties

    | Edit this page View Source

    EndIndex

    Returns the index of the end of the line.

    Declaration
    public LinearLocation EndIndex { get; }
    Property Value
    Type Description
    LinearLocation
    | Edit this page View Source

    StartIndex

    Returns the index of the start of the line.

    Declaration
    public LinearLocation StartIndex { get; }
    Property Value
    Type Description
    LinearLocation

    Methods

    | Edit this page View Source

    ClampIndex(LinearLocation)

    Computes a valid index for this line by clamping the given index to the valid range of index values.

    Declaration
    public LinearLocation ClampIndex(LinearLocation index)
    Parameters
    Type Name Description
    LinearLocation index
    Returns
    Type Description
    LinearLocation

    A valid index value.

    | Edit this page View Source

    ExtractLine(LinearLocation, LinearLocation)

    Computes the LineString for the interval on the line between the given indices. If the start location is after the end location, the computed linear geometry has reverse orientation to the input line.

    Declaration
    public Geometry ExtractLine(LinearLocation startIndex, LinearLocation endIndex)
    Parameters
    Type Name Description
    LinearLocation startIndex

    The index of the start of the interval.

    LinearLocation endIndex

    The index of the end of the interval.

    Returns
    Type Description
    Geometry

    The linear interval between the indices.

    | Edit this page View Source

    ExtractPoint(LinearLocation)

    Computes the Coordinatefor the point on the line at the given index. If the index is out of range, the first or last point on the line will be returned.

    Declaration
    public Coordinate ExtractPoint(LinearLocation index)
    Parameters
    Type Name Description
    LinearLocation index

    The index of the desired point.

    Returns
    Type Description
    Coordinate

    The Coordinate at the given index.

    Remarks

    The Z-ordinate of the computed point will be interpolated from the Z-ordinates of the line segment containing it, if they exist.

    | Edit this page View Source

    ExtractPoint(LinearLocation, double)

    Computes the Coordinate for the point on the line at the given index, offset by the given distance. If the index is out of range the first or last point on the line will be returned.

    The computed point is offset to the left of the line if the offset distance is positive, to the right if negative.

    The Z-ordinate of the computed point will be interpolated from the Z-ordinates of the line segment containing it, if they exist.
    Declaration
    public Coordinate ExtractPoint(LinearLocation index, double offsetDistance)
    Parameters
    Type Name Description
    LinearLocation index

    The index of the desired point

    double offsetDistance

    The distance the point is offset from the segment (positive is to the left, negative is to the right)

    Returns
    Type Description
    Coordinate

    The Coordinate at the given index

    | Edit this page View Source

    ExtractPoint(double, double)

    Computes the Coordinate for the point on the line at the given index, offset by the given distance.

    Declaration
    public Coordinate ExtractPoint(double index, double offsetDistance)
    Parameters
    Type Name Description
    double index

    The index of the desired point

    double offsetDistance

    The distance the point is offset from the segment (positive is to the left, negative is to the right)

    Returns
    Type Description
    Coordinate

    The Coordinate at the given index

    Remarks

    If the index is out of range the first or last point on the line will be returned. The computed point is offset to the left of the line if the offset distance is positive, to the right if negative. The Z-ordinate of the computed point will be interpolated from the Z-ordinates of the line segment containing it, if they exist.

    | Edit this page View Source

    IndexOf(Coordinate)

    Computes the index for a given point on the line. The supplied point does not necessarily have to lie precisely on the line, but if it is far from the line the accuracy and performance of this function is not guaranteed. Use Project(Coordinate) to compute a guaranteed result for points which may be far from the line.

    Declaration
    public LinearLocation IndexOf(Coordinate pt)
    Parameters
    Type Name Description
    Coordinate pt

    A point on the line.

    Returns
    Type Description
    LinearLocation

    The index of the point.

    See Also
    Project(Coordinate)
    | Edit this page View Source

    IndexOfAfter(Coordinate, LinearLocation)

    Finds the index for a point on the line which is greater than the given index. If no such index exists, returns minIndex.

    Declaration
    public LinearLocation IndexOfAfter(Coordinate pt, LinearLocation minIndex)
    Parameters
    Type Name Description
    Coordinate pt

    A point on the line

    LinearLocation minIndex

    The value the returned index must be greater than

    Returns
    Type Description
    LinearLocation

    The index of the point greater than the given minimum index

    Remarks

    This method can be used to determine all indexes for a point which occurs more than once on a non-simple line. It can also be used to disambiguate cases where the given point lies slightly off the line and is equidistant from two different points on the line.

    The supplied point does not necessarily have to lie precisely on the line, but if it is far from the line the accuracy and performance of this function is not guaranteed. Use Project(Coordinate) to compute a guaranteed result for points which may be far from the line.

    See Also
    Project(Coordinate)
    | Edit this page View Source

    IndicesOf(Geometry)

    Computes the indices for a subline of the line. (The subline must conform to the line; that is, all vertices in the subline (except possibly the first and last) must be vertices of the line and occur in the same order).

    Declaration
    public LinearLocation[] IndicesOf(Geometry subLine)
    Parameters
    Type Name Description
    Geometry subLine

    A subLine of the line.

    Returns
    Type Description
    LinearLocation[]

    A pair of indices for the start and end of the subline.

    | Edit this page View Source

    IsValidIndex(LinearLocation)

    Tests whether an index is in the valid index range for the line.

    Declaration
    public bool IsValidIndex(LinearLocation index)
    Parameters
    Type Name Description
    LinearLocation index

    The index to test.

    Returns
    Type Description
    bool

    true if the index is in the valid range.

    | Edit this page View Source

    Project(Coordinate)

    Computes the index for the closest point on the line to the given point. If more than one point has the closest distance the first one along the line is returned. (The point does not necessarily have to lie precisely on the line.)

    Declaration
    public LinearLocation Project(Coordinate pt)
    Parameters
    Type Name Description
    Coordinate pt

    A point on the line.

    Returns
    Type Description
    LinearLocation

    The index of the point.

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