Class CoordinateM
A lightweight class used to store coordinates on the 2-dimensional Cartesian plane and an additional measure (M) value.
This data object is suitable for use with coordinate sequences with
dimension
= 3 and measures
= 1.
Inherited Members
Namespace: NetTopologySuite.Geometries
Assembly: NetTopologySuite.dll
Syntax
[Serializable]
public sealed class CoordinateM : Coordinate, 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 CoordinateM
only contains ordinate values
and properties.
CoordinateM
s are two-dimensional points, with an additional M-ordinate.
If an M-ordinate value is not specified or not defined,
constructed coordinates have a M-ordinate of NaN
(which is also the value of NullOrdinate).
Apart from the basic accessor functions, NTS supports
only specific operations involving the 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.CoordinateM.this[int] indexer are recommended.
Constructors
| Improve this Doc View SourceCoordinateM()
Constructs a CoordinateM
at (0,0,NaN).
Declaration
public CoordinateM()
CoordinateM(Coordinate)
Constructs a CoordinateM
having the same (x,y) values as
c
.
Declaration
public CoordinateM(Coordinate c)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | c |
|
CoordinateM(Double, Double)
Constructs a CoordinateM
at (x,y,NaN).
Declaration
public CoordinateM(double x, double y)
Parameters
Type | Name | Description |
---|---|---|
Double | x | X value. |
Double | y | Y value. |
CoordinateM(Double, Double, Double)
Constructs a CoordinateM
at (x,y,z).
Declaration
public CoordinateM(double x, double y, double m)
Parameters
Type | Name | Description |
---|---|---|
Double | x | The X value |
Double | y | The Y value |
Double | m | The measure value |
Properties
| Improve this Doc View SourceCoordinateValue
Gets/Sets CoordinateM
s (x,y,z) values.
Declaration
public override Coordinate CoordinateValue { get; set; }
Property Value
Type | Description |
---|---|
Coordinate |
Overrides
| Improve this Doc View SourceItem[Int32]
Gets or sets the ordinate value for the given index.
Declaration
public override double this[int ordinateIndex] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | ordinateIndex | The ordinate index |
Property Value
Type | Description |
---|---|
Double | The ordinate value |
Overrides
Remarks
The base implementation supports 0 (X), 1 (Y) and 2 (M) as values for the index.
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown if |
M
Gets or sets the M-ordinate value.
Declaration
public override double M { get; set; }
Property Value
Type | Description |
---|---|
Double |
Overrides
Methods
| Improve this Doc View SourceCreate(Double, Double, Double, Double)
Create a Coordinate of the same type as this Coordinate,
using the provided values for x
, y
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 CoordinateM |
Overrides
Remarks
A provided value for z
will be silently dropped.
ToString()
Returns a string
of the form (x, y, m=m).
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
|