Class CoordinateArraySequence
A CoordinateSequence backed by an array of Coordinates. This is the implementation that Geometrys use by default.
Coordinates returned by ToCoordinateArray(), GetCoordinate(Int32) and GetCoordinate(Int32, 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.
Inherited Members
Namespace: NetTopologySuite.Geometries.Implementation
Assembly: NetTopologySuite.dll
Syntax
[Serializable]
public class CoordinateArraySequence : CoordinateSequence
Constructors
| Improve this Doc View SourceCoordinateArraySequence(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.
CoordinateArraySequence(Coordinate[], Int32)
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. |
Int32 | dimension | The dimension of the coordinates |
Remarks
The Array is not copied
CoordinateArraySequence(Coordinate[], Int32, Int32)
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. |
Int32 | dimension | The dimension of the coordinates |
Int32 | measures | The number of measure ordinate values. |
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 |
CoordinateArraySequence(Int32)
Constructs a sequence of a given size, populated with new Coordinates.
Declaration
public CoordinateArraySequence(int size)
Parameters
Type | Name | Description |
---|---|---|
Int32 | size | The size of the sequence to create. |
CoordinateArraySequence(Int32, Int32)
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 |
---|---|---|
Int32 | size | The size of the sequence to create. |
Int32 | dimension | the dimension of the coordinates |
CoordinateArraySequence(Int32, Int32, Int32)
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 |
---|---|---|
Int32 | size | The size of the sequence to create. |
Int32 | dimension | the dimension of the coordinates |
Int32 | measures | the number of measures of the coordinates |
Fields
| Improve this Doc View SourceCoordinates
Array of coordinates in sequence
Declaration
protected Coordinate[] Coordinates
Field Value
Type | Description |
---|---|
Coordinate[] |
Methods
| Improve this Doc View SourceCopy()
Creates a deep copy of the CoordinateArraySequence
.
Declaration
public override CoordinateSequence Copy()
Returns
Type | Description |
---|---|
CoordinateSequence | The deep copy. |
Overrides
| Improve this Doc View SourceEnforceArrayConsistency(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[] |
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
| Improve this Doc View SourceGetClonedCoordinates()
Declaration
protected Coordinate[] GetClonedCoordinates()
Returns
Type | Description |
---|---|
Coordinate[] |
GetCoordinate(Int32)
Get the Coordinate with index i.
Declaration
public override Coordinate GetCoordinate(int i)
Parameters
Type | Name | Description |
---|---|---|
Int32 | i | The index of the coordinate. |
Returns
Type | Description |
---|---|
Coordinate | The requested Coordinate instance. |
Overrides
| Improve this Doc View SourceGetCoordinate(Int32, 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 |
---|---|---|
Int32 | index | The index of the coordinate to copy. |
Coordinate | coord | A Coordinate to receive the value. |
Overrides
| Improve this Doc View SourceGetCoordinateCopy(Int32)
Get a copy of the Coordinate with index i.
Declaration
public override Coordinate GetCoordinateCopy(int i)
Parameters
Type | Name | Description |
---|---|---|
Int32 | i | The index of the coordinate. |
Returns
Type | Description |
---|---|
Coordinate | A copy of the requested Coordinate. |
Overrides
| Improve this Doc View SourceGetM(Int32)
Returns ordinate M of the specified coordinate if available.
Declaration
public override double GetM(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index |
Returns
Type | Description |
---|---|
Double | The value of the M ordinate in the index'th coordinate, or Double.NaN if not defined. |
Overrides
| Improve this Doc View SourceGetOrdinate(Int32, Int32)
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 |
---|---|---|
Int32 | index | The coordinate index in the sequence. |
Int32 | ordinateIndex | The ordinate index in the coordinate (in range [0, dimension-1]). |
Returns
Type | Description |
---|---|
Double |
Overrides
| Improve this Doc View SourceGetX(Int32)
Returns ordinate X (0) of the specified coordinate.
Declaration
public override double GetX(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index |
Returns
Type | Description |
---|---|
Double | The value of the X ordinate in the index'th coordinate. |
Overrides
| Improve this Doc View SourceGetY(Int32)
Returns ordinate Y (1) of the specified coordinate.
Declaration
public override double GetY(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index |
Returns
Type | Description |
---|---|
Double | The value of the Y ordinate in the index'th coordinate. |
Overrides
| Improve this Doc View SourceGetZ(Int32)
Returns ordinate Z of the specified coordinate if available.
Declaration
public override double GetZ(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index |
Returns
Type | Description |
---|---|
Double | The value of the Z ordinate in the index'th coordinate, or Double.NaN if not defined. |
Overrides
| Improve this Doc View SourceReversed()
Declaration
public override CoordinateSequence Reversed()
Returns
Type | Description |
---|---|
CoordinateSequence |
Overrides
| Improve this Doc View SourceSetOrdinate(Int32, Int32, 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 |
---|---|---|
Int32 | index | The coordinate index in the sequence. |
Int32 | ordinateIndex | The ordinate index in the coordinate (in range [0, dimension-1]). |
Double | value | The new ordinate value. |
Overrides
| Improve this Doc View SourceToCoordinateArray()
This method exposes the internal Array of Coordinate Objects.
Declaration
public override Coordinate[] ToCoordinateArray()
Returns
Type | Description |
---|---|
Coordinate[] |
Overrides
| Improve this Doc View SourceToString()
Returns the string representation of the coordinate array.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |