Search Results for

    Show / Hide Table of Contents

    Class CoordinateZ

    A lightweight class used to store coordinates on the 2-dimensional Cartesian plane and an additional z-ordinate (Z) value.

    This base data object is suitable for use with coordinate sequences with dimension = 3 and measures = 0.

    Inheritance
    object
    Coordinate
    CoordinateZ
    CoordinateZM
    Implements
    IComparable
    IComparable<Coordinate>
    Inherited Members
    Coordinate.NullOrdinate
    Coordinate.X
    Coordinate.Y
    Coordinate.M
    Coordinate.this[Ordinate]
    Coordinate.Deconstruct(out double, out double)
    Coordinate.IsValid
    Coordinate.Equals2D(Coordinate)
    Coordinate.Equals2D(Coordinate, double)
    Coordinate.EqualsWithTolerance(double, double, double)
    Coordinate.Equals(Coordinate)
    Coordinate.CompareTo(object)
    Coordinate.CompareTo(Coordinate)
    Coordinate.Copy()
    Coordinate.Distance(Coordinate)
    Coordinate.Equals(object)
    Coordinate.GetHashCode()
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: NetTopologySuite.Geometries
    Assembly: NetTopologySuite.dll
    Syntax
    [Serializable]
    public class CoordinateZ : 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 CoordinateZ only contains ordinate values and properties.

    CoordinateZs 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-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.CoordinateZ.this[int] indexer are recommended.

    Constructors

    | Edit this page View Source

    CoordinateZ()

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

    Declaration
    public CoordinateZ()
    | Edit this page View Source

    CoordinateZ(Coordinate)

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

    Declaration
    public CoordinateZ(Coordinate c)
    Parameters
    Type Name Description
    Coordinate c

    Coordinate to copy.

    | Edit this page View Source

    CoordinateZ(double, double)

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

    Declaration
    public CoordinateZ(double x, double y)
    Parameters
    Type Name Description
    double x

    X value.

    double y

    Y value.

    | Edit this page View Source

    CoordinateZ(double, double, double)

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

    Declaration
    public CoordinateZ(double x, double y, double z)
    Parameters
    Type Name Description
    double x

    The X value

    double y

    The Y value

    double z

    The Z value

    Properties

    | Edit this page View Source

    CoordinateValue

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

    Declaration
    public override Coordinate CoordinateValue { get; set; }
    Property Value
    Type Description
    Coordinate
    Overrides
    Coordinate.CoordinateValue
    | Edit this page View Source

    this[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
    Coordinate.this[int]
    Remarks

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

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown if ordinateIndex is not in the valid range.

    | Edit this page View Source

    Z

    Gets or sets the Z-ordinate value.

    Declaration
    public override sealed double Z { get; set; }
    Property Value
    Type Description
    double
    Overrides
    Coordinate.Z

    Methods

    | Edit this page View Source

    Create(double, double, double, double)

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

    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 0d.

    double y

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

    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 CoordinateZ

    Overrides
    Coordinate.Create(double, double, double, double)
    Remarks

    A provided value for m will be silently dropped.

    | Edit this page View Source

    Deconstruct(out double, out double, out double)

    Deconstructs this CoordinateZ into its x, y and z values.

    Declaration
    public void Deconstruct(out double x, out double y, out double z)
    Parameters
    Type Name Description
    double x

    The x-ordinate value

    double y

    The y-ordinate value

    double z

    The z-ordinate value

    | Edit this page View Source

    Distance3D(CoordinateZ)

    Computes the 3-dimensional Euclidean distance to another location.

    Declaration
    public double Distance3D(CoordinateZ c)
    Parameters
    Type Name Description
    CoordinateZ c

    A CoordinateZ with which to do the distance comparison.

    Returns
    Type Description
    double

    the 3-dimensional Euclidean distance between the locations.

    | Edit this page View Source

    EqualInZ(CoordinateZ, double)

    Tests if another CoordinateZ has the same value for Z, within a tolerance.

    Declaration
    public bool EqualInZ(CoordinateZ c, double tolerance)
    Parameters
    Type Name Description
    CoordinateZ c

    A CoordinateZ.

    double tolerance

    The tolerance value.

    Returns
    Type Description
    bool

    true if the Z ordinates are within the given tolerance.

    | Edit this page View Source

    Equals3D(CoordinateZ)

    Returns true if other has the same values for X, Y and Z.

    Declaration
    public bool Equals3D(CoordinateZ other)
    Parameters
    Type Name Description
    CoordinateZ other

    A CoordinateZ with which to do the 3D comparison.

    Returns
    Type Description
    bool

    true if other is a CoordinateZ with the same values for X, Y and Z.

    | Edit this page View Source

    ToString()

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

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    string of the form (x, y, z)

    Overrides
    Coordinate.ToString()

    Operators

    | Edit this page View Source

    implicit operator CoordinateZ((double x, double y, double z))

    Implicit conversion of a Tuple to a CoordinateZ.

    Declaration
    public static implicit operator CoordinateZ((double x, double y, double z) value)
    Parameters
    Type Name Description
    (double x, double y, double m) value
    Returns
    Type Description
    CoordinateZ
    | Edit this page View Source

    implicit operator CoordinateZ((double x, double y))

    Implicit conversion of a Tuple to a CoordinateZ.

    Declaration
    public static implicit operator CoordinateZ((double x, double y) value)
    Parameters
    Type Name Description
    (double x, double y) value
    Returns
    Type Description
    CoordinateZ

    Implements

    IComparable
    IComparable<T>
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX