Search Results for

    Show / Hide Table of Contents

    Class CoordinateArraySequence

    A CoordinateSequence backed by an array of Coordinates. This is the implementation that Geometrys use by default.

    Coordinates returned by ToCoordinateArray(), GetCoordinate(int) and GetCoordinate(int, Coordinate) are live -- modifications to them are actually changing the CoordinateSequence's underlying data. A dimension may be specified for the coordinates in the sequence, which may be 2 or 3. The actual coordinates will always have 3 ordinates, but the dimension is useful as metadata in some situations.
    Inheritance
    object
    CoordinateSequence
    CoordinateArraySequence
    Inherited Members
    CoordinateSequence.Dimension
    CoordinateSequence.Measures
    CoordinateSequence.Spatial
    CoordinateSequence.Ordinates
    CoordinateSequence.HasZ
    CoordinateSequence.HasM
    CoordinateSequence.ZOrdinateIndex
    CoordinateSequence.MOrdinateIndex
    CoordinateSequence.CreateCoordinate()
    CoordinateSequence.SetX(int, double)
    CoordinateSequence.SetY(int, double)
    CoordinateSequence.SetZ(int, double)
    CoordinateSequence.SetM(int, double)
    CoordinateSequence.GetOrdinate(int, Ordinate)
    CoordinateSequence.First
    CoordinateSequence.Last
    CoordinateSequence.Count
    CoordinateSequence.SetOrdinate(int, Ordinate, double)
    CoordinateSequence.TryGetOrdinateIndex(Ordinate, out int)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: NetTopologySuite.Geometries.Implementation
    Assembly: NetTopologySuite.dll
    Syntax
    [Serializable]
    public class CoordinateArraySequence : CoordinateSequence

    Constructors

    | Edit this page View Source

    CoordinateArraySequence(CoordinateSequence)

    Creates a new sequence based on a deep copy of the given CoordinateSequence.

    Declaration
    public CoordinateArraySequence(CoordinateSequence coordSeq)
    Parameters
    Type Name Description
    CoordinateSequence coordSeq

    The coordinate sequence that will be copied

    | Edit this page View Source

    CoordinateArraySequence(Coordinate[])

    Constructs a sequence based on the given array of Coordinates. The coordinate dimension defaults to 2

    Declaration
    public CoordinateArraySequence(Coordinate[] coordinates)
    Parameters
    Type Name Description
    Coordinate[] coordinates

    The coordinate array that will be referenced.

    Remarks

    The array is not copied.

    | Edit this page View Source

    CoordinateArraySequence(Coordinate[], int)

    Constructs a sequence based on the given array of Coordinates.

    Declaration
    [Obsolete("Use an overload that accepts measures.  This overload will be removed in a future release.")]
    public CoordinateArraySequence(Coordinate[] coordinates, int dimension)
    Parameters
    Type Name Description
    Coordinate[] coordinates

    The coordinate array that will be referenced.

    int dimension

    The dimension of the coordinates

    Remarks

    The Array is not copied

    | Edit this page View Source

    CoordinateArraySequence(Coordinate[], int, int)

    Constructs a sequence based on the given array of Coordinates.

    The Array is not copied

    It is your responsibility to ensure the array contains Coordinates of the indicated dimension and measures (See EnforceConsistency(Coordinate[])).
    Declaration
    public CoordinateArraySequence(Coordinate[] coordinates, int dimension, int measures)
    Parameters
    Type Name Description
    Coordinate[] coordinates

    The coordinate array that will be referenced.

    int dimension

    The dimension of the coordinates

    int measures

    The number of measure ordinate values.

    | Edit this page View Source

    CoordinateArraySequence(int)

    Constructs a sequence of a given size, populated with new Coordinates.

    Declaration
    public CoordinateArraySequence(int size)
    Parameters
    Type Name Description
    int size

    The size of the sequence to create.

    | Edit this page View Source

    CoordinateArraySequence(int, int)

    Constructs a sequence of a given size, populated with new Coordinates of the given dimension.

    Declaration
    [Obsolete("Use an overload that accepts measures.  This overload will be removed in a future release.")]
    public CoordinateArraySequence(int size, int dimension)
    Parameters
    Type Name Description
    int size

    The size of the sequence to create.

    int dimension

    the dimension of the coordinates

    | Edit this page View Source

    CoordinateArraySequence(int, int, int)

    Constructs a sequence of a given size, populated with new Coordinates of the given dimension with the given number of measures

    Declaration
    public CoordinateArraySequence(int size, int dimension, int measures)
    Parameters
    Type Name Description
    int size

    The size of the sequence to create.

    int dimension

    the dimension of the coordinates

    int measures

    the number of measures of the coordinates

    Fields

    | Edit this page View Source

    Coordinates

    Array of coordinates in sequence

    Declaration
    protected Coordinate[] Coordinates
    Field Value
    Type Description
    Coordinate[]

    Methods

    | Edit this page View Source

    Copy()

    Creates a deep copy of the CoordinateArraySequence.

    Declaration
    public override CoordinateSequence Copy()
    Returns
    Type Description
    CoordinateSequence

    The deep copy.

    Overrides
    CoordinateSequence.Copy()
    | Edit this page View Source

    EnforceArrayConsistency(Coordinate[])

    Ensure array contents of the same type, making use of CreateCoordinate() as needed.

    A new array will be created if needed to return a consistent result.

    Declaration
    [Obsolete("It is the clients responsibility to provide consistent arrays")]
    protected Coordinate[] EnforceArrayConsistency(Coordinate[] array)
    Parameters
    Type Name Description
    Coordinate[] array

    array containing consistent coordinate instances

    Returns
    Type Description
    Coordinate[]
    | Edit this page View Source

    ExpandEnvelope(Envelope)

    Expands the given Envelope to include the coordinates in the sequence. Allows implementing classes to optimize access to coordinate values.

    Declaration
    public override Envelope ExpandEnvelope(Envelope env)
    Parameters
    Type Name Description
    Envelope env

    The envelope to expand.

    Returns
    Type Description
    Envelope

    A reference to the expanded envelope.

    Overrides
    CoordinateSequence.ExpandEnvelope(Envelope)
    | Edit this page View Source

    GetClonedCoordinates()

    Declaration
    protected Coordinate[] GetClonedCoordinates()
    Returns
    Type Description
    Coordinate[]
    | Edit this page View Source

    GetCoordinate(int)

    Get the Coordinate with index i.

    Declaration
    public override Coordinate GetCoordinate(int i)
    Parameters
    Type Name Description
    int i

    The index of the coordinate.

    Returns
    Type Description
    Coordinate

    The requested Coordinate instance.

    Overrides
    CoordinateSequence.GetCoordinate(int)
    | Edit this page View Source

    GetCoordinate(int, Coordinate)

    Copies the i'th coordinate in the sequence to the supplied Coordinate.

    Declaration
    public override void GetCoordinate(int index, Coordinate coord)
    Parameters
    Type Name Description
    int index

    The index of the coordinate to copy.

    Coordinate coord

    A Coordinate to receive the value.

    Overrides
    CoordinateSequence.GetCoordinate(int, Coordinate)
    | Edit this page View Source

    GetCoordinateCopy(int)

    Get a copy of the Coordinate with index i.

    Declaration
    public override Coordinate GetCoordinateCopy(int i)
    Parameters
    Type Name Description
    int i

    The index of the coordinate.

    Returns
    Type Description
    Coordinate

    A copy of the requested Coordinate.

    Overrides
    CoordinateSequence.GetCoordinateCopy(int)
    | Edit this page View Source

    GetM(int)

    Returns ordinate M of the specified coordinate if available.

    Declaration
    public override double GetM(int index)
    Parameters
    Type Name Description
    int index
    Returns
    Type Description
    double

    The value of the M ordinate in the index'th coordinate, or Double.NaN if not defined.

    Overrides
    CoordinateSequence.GetM(int)
    | Edit this page View Source

    GetOrdinate(int, int)

    Returns the ordinate of a coordinate in this sequence. Ordinate indices 0 and 1 are assumed to be X and Y. Ordinate indices greater than 1 have user-defined semantics (for instance, they may contain other dimensions or measure values).

    Declaration
    public override double GetOrdinate(int index, int ordinateIndex)
    Parameters
    Type Name Description
    int index

    The coordinate index in the sequence.

    int ordinateIndex

    The ordinate index in the coordinate (in range [0, dimension-1]).

    Returns
    Type Description
    double
    Overrides
    CoordinateSequence.GetOrdinate(int, int)
    | Edit this page View Source

    GetX(int)

    Returns ordinate X (0) of the specified coordinate.

    Declaration
    public override double GetX(int index)
    Parameters
    Type Name Description
    int index
    Returns
    Type Description
    double

    The value of the X ordinate in the index'th coordinate.

    Overrides
    CoordinateSequence.GetX(int)
    | Edit this page View Source

    GetY(int)

    Returns ordinate Y (1) of the specified coordinate.

    Declaration
    public override double GetY(int index)
    Parameters
    Type Name Description
    int index
    Returns
    Type Description
    double

    The value of the Y ordinate in the index'th coordinate.

    Overrides
    CoordinateSequence.GetY(int)
    | Edit this page View Source

    GetZ(int)

    Returns ordinate Z of the specified coordinate if available.

    Declaration
    public override double GetZ(int index)
    Parameters
    Type Name Description
    int index
    Returns
    Type Description
    double

    The value of the Z ordinate in the index'th coordinate, or Double.NaN if not defined.

    Overrides
    CoordinateSequence.GetZ(int)
    | Edit this page View Source

    Reversed()

    Returns a reversed copy of this CoordinateSequence.

    Declaration
    public override CoordinateSequence Reversed()
    Returns
    Type Description
    CoordinateSequence

    A reversed copy of this CoordinateSequence.

    Overrides
    CoordinateSequence.Reversed()
    Exceptions
    Type Condition
    InvalidOperationException

    Thrown when Copy() returned null.

    | Edit this page View Source

    SetOrdinate(int, int, double)

    Sets the value for a given ordinate of a coordinate in this sequence.

    Declaration
    public override void SetOrdinate(int index, int ordinateIndex, double value)
    Parameters
    Type Name Description
    int index

    The coordinate index in the sequence.

    int ordinateIndex

    The ordinate index in the coordinate (in range [0, dimension-1]).

    double value

    The new ordinate value.

    Overrides
    CoordinateSequence.SetOrdinate(int, int, double)
    | Edit this page View Source

    ToCoordinateArray()

    This method exposes the internal Array of Coordinate Objects.

    Declaration
    public override Coordinate[] ToCoordinateArray()
    Returns
    Type Description
    Coordinate[]
    Overrides
    CoordinateSequence.ToCoordinateArray()
    | Edit this page View Source

    ToString()

    Returns the string representation of the coordinate array.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()

    Extension Methods

    CoordinateSequenceEx.GetHashCode(CoordinateSequence, int, Func<int, int>)
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX