Class CoordinateZM
A lightweight class used to store coordinates on the 2-dimensional Cartesian plane and additional z- and m-ordinate values (Z, M).
This data object is suitable for use with coordinate sequences with
dimension = 4 and measures = 1.
Inherited Members
Namespace: NetTopologySuite.Geometries
Assembly: NetTopologySuite.dll
Syntax
[Serializable]
public sealed class CoordinateZM : CoordinateZ, IComparable, IComparable<Coordinate>
Remarks
It is distinct from Point, which is a subclass of Geometry.
Unlike objects of type Point (which contain additional
information such as an envelope, a precision model, and spatial reference
system information), a CoordinateZM only contains ordinate values
and properties.
CoordinateZMs are two-dimensional points, with an additional Z-ordinate.
If an Z-ordinate value is not specified or not defined,
constructed coordinates have a Z-ordinate of NaN
(which is also the value of NullOrdinate).
Apart from the basic accessor functions, NTS supports
only specific operations involving the Z- and/or M-ordinate.
Implementations may optionally support Z-ordinate and M-measure values
as appropriate for a CoordinateSequence. Use of Z
and M setters or NetTopologySuite.Geometries.CoordinateZM.this[int] indexer are recommended.
Constructors
| Edit this page View SourceCoordinateZM()
Constructs a CoordinateZM at (0,0,NaN,NaN).
Declaration
public CoordinateZM()
CoordinateZM(Coordinate)
Constructs a CoordinateZM having the same (x,y) values as
c.
Declaration
public CoordinateZM(Coordinate c)
Parameters
| Type | Name | Description |
|---|---|---|
| Coordinate | c |
|
CoordinateZM(double, double)
Constructs a CoordinateZM at (x,y,NaN).
Declaration
public CoordinateZM(double x, double y)
Parameters
| Type | Name | Description |
|---|---|---|
| double | x | X value. |
| double | y | Y value. |
CoordinateZM(double, double, double, double)
Constructs a CoordinateZM at (x,y,z).
Declaration
public CoordinateZM(double x, double y, double z, double m)
Parameters
| Type | Name | Description |
|---|---|---|
| double | x | The X value |
| double | y | The Y value |
| double | z | The Z value |
| double | m | The Measure value |
Properties
| Edit this page View SourceCoordinateValue
Gets/Sets CoordinateZMs (x,y,z) values.
Declaration
public override Coordinate CoordinateValue { get; set; }
Property Value
| Type | Description |
|---|---|
| Coordinate |
Overrides
| Edit this page View Sourcethis[int]
Gets or sets the ordinate value for the given index.
Declaration
public override double this[int ordinateIndex] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | ordinateIndex | The ordinate index |
Property Value
| Type | Description |
|---|---|
| double | The ordinate value |
Overrides
Remarks
The base implementation supports 0 (X), 1 (Y) and 2 (Z) as values for the index.
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | Thrown if |
M
Gets or sets the measure-ordinate value.
Declaration
public override double M { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Overrides
Methods
| Edit this page View SourceCreate(double, double, double, double)
Create a Coordinate of the same type as this Coordinate,
using the provided values for x, y, z and m.
Declaration
public override Coordinate Create(double x = 0, double y = 0, double z = NaN, double m = NaN)
Parameters
| Type | Name | Description |
|---|---|---|
| double | x | The x-ordinate value, if not provided, it is |
| double | y | The y-ordinate value, if not provided, it is |
| double | z | The z-ordinate value, if not provided, it is NullOrdinate. |
| double | m | The m-ordinate value, if not provided, it is NullOrdinate. |
Returns
| Type | Description |
|---|---|
| Coordinate | A new CoordinateZM |
Overrides
| Edit this page View SourceDeconstruct(out double, out double, out double, out double)
Deconstructs this CoordinateZM into its x, y, z and values.
Declaration
public void Deconstruct(out double x, out double y, out double z, out double m)
Parameters
| Type | Name | Description |
|---|---|---|
| double | x | The x-ordinate value |
| double | y | The y-ordinate value |
| double | z | The z-ordinate value |
| double | m |
ToString()
Returns a string of the form (x, y, z, m=m) .
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |
|
Overrides
Operators
| Edit this page View Sourceimplicit operator CoordinateZM((double x, double y, double z, double m))
Implicit conversion of a Tuple to a CoordinateZM.
Declaration
public static implicit operator CoordinateZM((double x, double y, double z, double m) value)
Parameters
| Type | Name | Description |
|---|---|---|
| (double x, double y, double z, double m) | value |
Returns
| Type | Description |
|---|---|
| CoordinateZM |
implicit operator CoordinateZM((double x, double y))
Implicit conversion of a Tuple to a CoordinateZM.
Declaration
public static implicit operator CoordinateZM((double x, double y) value)
Parameters
| Type | Name | Description |
|---|---|---|
| (double x, double y) | value |
Returns
| Type | Description |
|---|---|
| CoordinateZM |