Table of Contents

Class CoordinateZM

Namespace
NetTopologySuite.Geometries
Assembly
NetTopologySuite.dll

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.

public sealed class CoordinateZM : CoordinateZ, IComparable, IComparable<Coordinate>
Inheritance
CoordinateZM
Implements
Inherited Members

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

CoordinateZM()

Constructs a CoordinateZM at (0,0,NaN,NaN).

public CoordinateZM()

CoordinateZM(Coordinate)

Constructs a CoordinateZM having the same (x,y) values as c.

public CoordinateZM(Coordinate c)

Parameters

c Coordinate

Coordinate to copy.

CoordinateZM(double, double)

Constructs a CoordinateZM at (x,y,NaN).

public CoordinateZM(double x, double y)

Parameters

x double

X value.

y double

Y value.

CoordinateZM(double, double, double, double)

Constructs a CoordinateZM at (x,y,z).

public CoordinateZM(double x, double y, double z, double m)

Parameters

x double

The X value

y double

The Y value

z double

The Z value

m double

The Measure value

Properties

CoordinateValue

Gets/Sets CoordinateZMs (x,y,z) values.

public override Coordinate CoordinateValue { get; set; }

Property Value

Coordinate

this[int]

Gets or sets the ordinate value for the given index.

public override double this[int ordinateIndex] { get; set; }

Parameters

ordinateIndex int

The ordinate index

Property Value

double

The ordinate value

Remarks

The base implementation supports 0 (X), 1 (Y) and 2 (Z) as values for the index.

Exceptions

ArgumentOutOfRangeException

Thrown if ordinateIndex is not in the valid range.

M

Gets or sets the measure-ordinate value.

public override double M { get; set; }

Property Value

double

Methods

Create(double, double, double, double)

Create a Coordinate of the same type as this Coordinate, using the provided values for x, y, z and m.

public override Coordinate Create(double x = 0, double y = 0, double z = NaN, double m = NaN)

Parameters

x double

The x-ordinate value, if not provided, it is 0d.

y double

The y-ordinate value, if not provided, it is 0d.

z double

The z-ordinate value, if not provided, it is NullOrdinate.

m double

The m-ordinate value, if not provided, it is NullOrdinate.

Returns

Coordinate

A new CoordinateZM

ToString()

Returns a string of the form (x, y, z, m=m) .

public override string ToString()

Returns

string

string of the form (x, y, z, m=m)