Search Results for

    Show / Hide Table of Contents

    Class LineString

    Models an OGC-style LineString

    Inheritance
    object
    Geometry
    LineString
    LinearRing
    Implements
    IComparable
    IComparable<Geometry>
    ILineal
    Inherited Members
    Geometry.TypeNamePoint
    Geometry.TypeNameMultiPoint
    Geometry.TypeNameLineString
    Geometry.TypeNameLinearRing
    Geometry.TypeNameMultiLineString
    Geometry.TypeNamePolygon
    Geometry.TypeNameMultiPolygon
    Geometry.TypeNameGeometryCollection
    Geometry.Factory
    Geometry.UserData
    Geometry.SRID
    Geometry.HasNonEmptyElements(Geometry[])
    Geometry.HasNullElements(object[])
    Geometry.HasNullElements<T>(IEnumerable<T>)
    Geometry.PrecisionModel
    Geometry.NumGeometries
    Geometry.GetGeometryN(int)
    Geometry.IsSimple
    Geometry.IsValid
    Geometry.Distance(Geometry)
    Geometry.IsWithinDistance(Geometry, double)
    Geometry.Area
    Geometry.Centroid
    Geometry.InteriorPoint
    Geometry.PointOnSurface
    Geometry.HasDimension(Dimension)
    Geometry.Envelope
    Geometry.EnvelopeInternal
    Geometry.GeometryChanged()
    Geometry.GeometryChangedAction()
    Geometry.Disjoint(Geometry)
    Geometry.Touches(Geometry)
    Geometry.Intersects(Geometry)
    Geometry.Crosses(Geometry)
    Geometry.Within(Geometry)
    Geometry.Contains(Geometry)
    Geometry.Overlaps(Geometry)
    Geometry.Covers(Geometry)
    Geometry.CoveredBy(Geometry)
    Geometry.Relate(Geometry, string)
    Geometry.Relate(Geometry)
    Geometry.Equals(Geometry)
    Geometry.EqualsTopologically(Geometry)
    Geometry.Equals(object)
    Geometry.GetHashCode()
    Geometry.ToString()
    Geometry.ToText()
    Geometry.AsText()
    Geometry.ToBinary()
    Geometry.AsBinary()
    Geometry.ToGMLFeature()
    Geometry.Buffer(double)
    Geometry.Buffer(double, EndCapStyle)
    Geometry.Buffer(double, int)
    Geometry.Buffer(double, int, EndCapStyle)
    Geometry.Buffer(double, BufferParameters)
    Geometry.ConvexHull()
    Geometry.Intersection(Geometry)
    Geometry.Union(Geometry)
    Geometry.Difference(Geometry)
    Geometry.SymmetricDifference(Geometry)
    Geometry.Union()
    Geometry.EqualsExact(Geometry)
    Geometry.EqualsNormalized(Geometry)
    Geometry.Copy()
    Geometry.Normalized()
    Geometry.CompareTo(object)
    Geometry.CompareTo(Geometry)
    Geometry.CompareTo(object, IComparer<CoordinateSequence>)
    Geometry.CheckNotGeometryCollection(Geometry)
    Geometry.IsGeometryCollection
    Geometry.Compare(List<Geometry>, List<Geometry>)
    Geometry.Equal(Coordinate, Coordinate, double)
    Geometry.IsRectangle
    Geometry.DefaultFactory
    Geometry.CreateArray(int, double)
    Geometry.CreateArray(CoordinateSequence, Ordinate)
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: NetTopologySuite.Geometries
    Assembly: NetTopologySuite.dll
    Syntax
    [Serializable]
    public class LineString : Geometry, IComparable, IComparable<Geometry>, ILineal
    Remarks

    A LineString consists of a sequence of two or more vertices, along with all points along the linearly-interpolated curves (line segments) between each pair of consecutive vertices. Consecutive vertices may be equal. The line segments in the line may intersect each other (in other words, the LineString may "curl back" in itself and self-intersect. LineStrings with exactly two identical points are invalid.

    A LineString must have either 0 or MinimumValidSize or more points. If these conditions are not met, the constructors throw an ArgumentException.

    Constructors

    | Edit this page View Source

    LineString(CoordinateSequence, GeometryFactory)

    Initializes a new instance of the LineString class.

    Declaration
    public LineString(CoordinateSequence points, GeometryFactory factory)
    Parameters
    Type Name Description
    CoordinateSequence points

    The points of the LineString, or null to create the empty point. Consecutive points may not be equal.

    GeometryFactory factory
    Exceptions
    Type Condition
    ArgumentException

    If too few points are provided

    | Edit this page View Source

    LineString(Coordinate[])

    Initializes a new instance of the LineString class.

    Declaration
    public LineString(Coordinate[] points)
    Parameters
    Type Name Description
    Coordinate[] points

    The coordinates used for create this LineString.

    Remarks

    For create this Geometry is used a standard GeometryFactory with PrecisionModel == Floating.

    Exceptions
    Type Condition
    ArgumentException

    If too few points are provided

    Fields

    | Edit this page View Source

    Empty

    Represents an empty LineString.

    Declaration
    public static readonly LineString Empty
    Field Value
    Type Description
    LineString
    | Edit this page View Source

    MinimumValidSize

    The minimum number of vertices allowed in a valid non-empty linestring. Empty linestrings with 0 vertices are also valid.

    Declaration
    public const int MinimumValidSize = 2
    Field Value
    Type Description
    int

    Properties

    | Edit this page View Source

    Boundary

    Returns the boundary, or an empty geometry of appropriate dimension if this Geometry is empty. For a discussion of this function, see the OpenGIS Simple Features Specification. As stated in SFS Section 2.1.13.1, "the boundary of a Geometry is a set of Geometries of the next lower dimension."

    Declaration
    public override Geometry Boundary { get; }
    Property Value
    Type Description
    Geometry

    The closure of the combinatorial boundary of this Geometry.

    Overrides
    Geometry.Boundary
    | Edit this page View Source

    BoundaryDimension

    Declaration
    public override Dimension BoundaryDimension { get; }
    Property Value
    Type Description
    Dimension
    Overrides
    Geometry.BoundaryDimension
    | Edit this page View Source

    Coordinate

    Declaration
    public override Coordinate Coordinate { get; }
    Property Value
    Type Description
    Coordinate
    Overrides
    Geometry.Coordinate
    | Edit this page View Source

    CoordinateSequence

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

    Coordinates

    Returns an array containing the values of all the vertices for this geometry.

    Declaration
    public override Coordinate[] Coordinates { get; }
    Property Value
    Type Description
    Coordinate[]

    The vertices of this Geometry.

    Overrides
    Geometry.Coordinates
    Remarks

    If the geometry is a composite, the array will contain all the vertices for the components, in the order in which the components occur in the geometry.

    In general, the array cannot be assumed to be the actual internal storage for the vertices. Thus modifying the array may not modify the geometry itself. Use the SetOrdinate(int, int, double) method (possibly on the components) to modify the underlying data. If the coordinates are modified, GeometryChanged() must be called afterwards.

    See Also
    GeometryChanged()
    SetOrdinate(int, int, double)
    SetOrdinate(int, Ordinate, double)
    | Edit this page View Source

    Count

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

    Dimension

    Declaration
    public override Dimension Dimension { get; }
    Property Value
    Type Description
    Dimension
    Overrides
    Geometry.Dimension
    | Edit this page View Source

    EndPoint

    Gets a value indicating the end point of this LINESTRING

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

    GeometryType

    Returns the name of this object's interface.

    Declaration
    public override string GeometryType { get; }
    Property Value
    Type Description
    string

    "LineString"

    Overrides
    Geometry.GeometryType
    | Edit this page View Source

    IsClosed

    Gets a value indicating if this LINESTRING is closed.

    Declaration
    public virtual bool IsClosed { get; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    IsEmpty

    Declaration
    public override bool IsEmpty { get; }
    Property Value
    Type Description
    bool
    Overrides
    Geometry.IsEmpty
    | Edit this page View Source

    IsRing

    Gets a value indicating if this LINESTRING forms a ring.

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

    this[int]

    Declaration
    public Coordinate this[int n] { get; set; }
    Parameters
    Type Name Description
    int n
    Property Value
    Type Description
    Coordinate
    | Edit this page View Source

    Length

    Returns the length of this LineString

    Declaration
    public override double Length { get; }
    Property Value
    Type Description
    double

    The length of the polygon.

    Overrides
    Geometry.Length
    | Edit this page View Source

    NumPoints

    Declaration
    public override int NumPoints { get; }
    Property Value
    Type Description
    int
    Overrides
    Geometry.NumPoints
    | Edit this page View Source

    OgcGeometryType

    Gets the OGC geometry type

    Declaration
    public override OgcGeometryType OgcGeometryType { get; }
    Property Value
    Type Description
    OgcGeometryType
    Overrides
    Geometry.OgcGeometryType
    | Edit this page View Source

    SortIndex

    Gets a value to sort the geometry

    Declaration
    protected override Geometry.SortIndexValue SortIndex { get; }
    Property Value
    Type Description
    Geometry.SortIndexValue
    Overrides
    Geometry.SortIndex
    Remarks

    NOTE:
    For JTS v1.17 this property's getter has been renamed to getTypeCode(). In order not to break binary compatibility we did not follow.

    | Edit this page View Source

    StartPoint

    Gets a value indicating the start point of this LINESTRING

    Declaration
    public Point StartPoint { get; }
    Property Value
    Type Description
    Point

    Methods

    | Edit this page View Source

    Apply(ICoordinateFilter)

    Declaration
    public override void Apply(ICoordinateFilter filter)
    Parameters
    Type Name Description
    ICoordinateFilter filter
    Overrides
    Geometry.Apply(ICoordinateFilter)
    | Edit this page View Source

    Apply(ICoordinateSequenceFilter)

    Performs an operation on the coordinates in this Geometry's CoordinateSequences.

    Declaration
    public override void Apply(ICoordinateSequenceFilter filter)
    Parameters
    Type Name Description
    ICoordinateSequenceFilter filter

    The filter to apply

    Overrides
    Geometry.Apply(ICoordinateSequenceFilter)
    Remarks

    If the filter reports that a coordinate value has been changed, GeometryChanged() will be called automatically.

    | Edit this page View Source

    Apply(IEntireCoordinateSequenceFilter)

    Performs an operation on this Geometry's CoordinateSequences.

    Declaration
    public override void Apply(IEntireCoordinateSequenceFilter filter)
    Parameters
    Type Name Description
    IEntireCoordinateSequenceFilter filter

    The filter to apply

    Overrides
    Geometry.Apply(IEntireCoordinateSequenceFilter)
    Remarks

    If the filter reports that a coordinate value has been changed, GeometryChanged() will be called automatically.

    | Edit this page View Source

    Apply(IGeometryComponentFilter)

    Performs an operation with or on this Geometry and its component Geometry's. Only GeometryCollections and Polygons have component Geometry's; for Polygons they are the LinearRings of the shell and holes.

    Declaration
    public override void Apply(IGeometryComponentFilter filter)
    Parameters
    Type Name Description
    IGeometryComponentFilter filter

    The filter to apply to this Geometry.

    Overrides
    Geometry.Apply(IGeometryComponentFilter)
    | Edit this page View Source

    Apply(IGeometryFilter)

    Performs an operation with or on this Geometry and its subelement Geometrys (if any). Only GeometryCollections and subclasses have subelement Geometry's.

    Declaration
    public override void Apply(IGeometryFilter filter)
    Parameters
    Type Name Description
    IGeometryFilter filter

    The filter to apply to this Geometry (and its children, if it is a GeometryCollection).

    Overrides
    Geometry.Apply(IGeometryFilter)
    | Edit this page View Source

    CompareToSameClass(object)

    Returns whether this Geometry is greater than, equal to, or less than another Geometry having the same class.

    Declaration
    protected override int CompareToSameClass(object o)
    Parameters
    Type Name Description
    object o

    A Geometry having the same class as this Geometry.

    Returns
    Type Description
    int

    A positive number, 0, or a negative number, depending on whether this object is greater than, equal to, or less than o, as defined in "Normal Form For Geometry" in the NTS Technical Specifications.

    Overrides
    Geometry.CompareToSameClass(object)
    | Edit this page View Source

    CompareToSameClass(object, IComparer<CoordinateSequence>)

    Returns whether this Geometry is greater than, equal to, or less than another Geometry of the same class. using the given IComparer<T>.

    Declaration
    protected override int CompareToSameClass(object o, IComparer<CoordinateSequence> comp)
    Parameters
    Type Name Description
    object o

    A Geometry having the same class as this Geometry

    IComparer<CoordinateSequence> comp

    The comparer

    Returns
    Type Description
    int

    A positive number, 0, or a negative number, depending on whether this object is greater than, equal to, or less than o, as defined in "Normal Form For Geometry" in the JTS Technical Specifications

    Overrides
    Geometry.CompareToSameClass(object, IComparer<CoordinateSequence>)
    | Edit this page View Source

    ComputeEnvelopeInternal()

    Declaration
    protected override Envelope ComputeEnvelopeInternal()
    Returns
    Type Description
    Envelope
    Overrides
    Geometry.ComputeEnvelopeInternal()
    | Edit this page View Source

    CopyInternal()

    An internal method to copy subclass-specific geometry data.

    Declaration
    protected override Geometry CopyInternal()
    Returns
    Type Description
    Geometry

    A copy of the target geometry object.

    Overrides
    Geometry.CopyInternal()
    | Edit this page View Source

    EqualsExact(Geometry, double)

    Declaration
    public override bool EqualsExact(Geometry other, double tolerance)
    Parameters
    Type Name Description
    Geometry other
    double tolerance
    Returns
    Type Description
    bool
    Overrides
    Geometry.EqualsExact(Geometry, double)
    | Edit this page View Source

    GetCoordinateN(int)

    Declaration
    public Coordinate GetCoordinateN(int n)
    Parameters
    Type Name Description
    int n
    Returns
    Type Description
    Coordinate
    | Edit this page View Source

    GetOrdinates(Ordinate)

    Gets an array of double ordinate values

    Declaration
    public override double[] GetOrdinates(Ordinate ordinate)
    Parameters
    Type Name Description
    Ordinate ordinate

    The ordinate index

    Returns
    Type Description
    double[]

    An array of ordinate values

    Overrides
    Geometry.GetOrdinates(Ordinate)
    | Edit this page View Source

    GetPointN(int)

    Gets

    Declaration
    public Point GetPointN(int n)
    Parameters
    Type Name Description
    int n
    Returns
    Type Description
    Point
    | Edit this page View Source

    IsCoordinate(Coordinate)

    Returns true if the given point is a vertex of this LineString.

    Declaration
    public virtual bool IsCoordinate(Coordinate pt)
    Parameters
    Type Name Description
    Coordinate pt

    The Coordinate to check.

    Returns
    Type Description
    bool

    true if pt is one of this LineString's vertices.

    | Edit this page View Source

    IsEquivalentClass(Geometry)

    Returns whether the two Geometrys are equal, from the point of view of the EqualsExact method. Called by EqualsExact . In general, two Geometry classes are considered to be "equivalent" only if they are the same class. An exception is LineString , which is considered to be equivalent to its subclasses.

    Declaration
    protected override bool IsEquivalentClass(Geometry other)
    Parameters
    Type Name Description
    Geometry other

    The Geometry with which to compare this Geometry for equality.

    Returns
    Type Description
    bool

    true if the classes of the two Geometry s are considered to be equal by the equalsExact method.

    Overrides
    Geometry.IsEquivalentClass(Geometry)
    | Edit this page View Source

    Normalize()

    Normalizes a LineString. A normalized LineString has the first point which is not equal to it's reflected point less than the reflected point.

    Declaration
    public override void Normalize()
    Overrides
    Geometry.Normalize()
    | Edit this page View Source

    Reverse()

    Creates a LineString whose coordinates are in the reverse order of this objects.

    Declaration
    [Obsolete("Call Geometry.Reverse()")]
    public override Geometry Reverse()
    Returns
    Type Description
    Geometry

    A LineString with coordinates in the reverse order.

    Overrides
    Geometry.Reverse()
    | Edit this page View Source

    ReverseInternal()

    The actual implementation of the Reverse() function for LINESTRINGs.

    Declaration
    protected override Geometry ReverseInternal()
    Returns
    Type Description
    Geometry

    A reversed geometry

    Overrides
    Geometry.ReverseInternal()

    Implements

    IComparable
    IComparable<T>
    ILineal

    Extension Methods

    PolygonalExtracter.GetPolygonals<TCollection>(Geometry)
    PolygonalExtracter.GetPolygonals<TCollection>(Geometry, TCollection)
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX