Struct LatLonAltitude
A geographic position with altitude, one item of a 3D path (a measured line, a trail, an imported track).
public readonly struct LatLonAltitude : IEquatable<LatLonAltitude>
- Implements
Remarks
Replaces a List<LatLon> paired with a separate
List<double> of altitudes kept index-aligned by
convention only: nothing stopped the two lists from growing to
different lengths or being mutated out of step. A single
List<LatLonAltitude> makes that desync unrepresentable,
since position and altitude can no longer be added, removed, or
reordered independently.
Constructors
LatLonAltitude(LatLon, double)
Creates a position with altitude.
public LatLonAltitude(LatLon position, double altitudeMeters)
Parameters
positionLatLonGeographic position in degrees WGS84.
altitudeMetersdoubleAltitude in meters above the map plane.
Properties
AltitudeMeters
Altitude in meters above the map plane.
public double AltitudeMeters { get; }
Property Value
Position
The geographic position in degrees WGS84.
public LatLon Position { get; }
Property Value
Methods
Equals(LatLonAltitude)
Exact component-wise equality. No tolerance.
public bool Equals(LatLonAltitude other)
Parameters
otherLatLonAltitude
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
ToString()
Returns "(lat,lon)@altM".
public override string ToString()