Class GpsPoint
Represents a GPS point with latitude, longitude, and optional altitude.
public sealed class GpsPoint : IEquatable<GpsPoint>
- Inheritance
-
GpsPoint
- Implements
- Inherited Members
Constructors
GpsPoint(GpsPosition?, GpsPosition?, FixedPoint32?)
Represents a GPS point with latitude, longitude, and optional altitude.
public GpsPoint(GpsPosition? _latitude = null, GpsPosition? _longitude = null, FixedPoint32? _altitude = null)
Parameters
_latitudeGpsPosition?The optional latitude.
_longitudeGpsPosition?The optional longitude.
_altitudeFixedPoint32?The optional altitude in meters.
GpsPoint(GpsPosition, GpsPosition, float)
Initializes a new instance of the GpsPoint class with specified latitude, longitude, and altitude.
public GpsPoint(GpsPosition latitude, GpsPosition longitude, float altitude)
Parameters
latitudeGpsPositionThe latitude of the GPS point.
longitudeGpsPositionThe longitude of the GPS point.
altitudefloatThe altitude of the GPS point in meters.
Properties
Altitude
Gets the altitude of the GPS point.
public FixedPoint32? Altitude { get; }
Property Value
IsSet
Gets a value indicating whether both latitude and longitude are set.
public bool IsSet { get; }
Property Value
Latitude
Gets the latitude of the GPS point.
public GpsPosition? Latitude { get; }
Property Value
Longitude
Gets the longitude of the GPS point.
public GpsPosition? Longitude { get; }
Property Value
Undefined
Gets an undefined GPS point.
public static GpsPoint Undefined { get; }
Property Value
Methods
Equals(object)
Determines whether the specified object is equal to the current GPS point.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current GPS point.
Returns
- bool
True if the specified object is equal to the current GPS point; otherwise, false.
Equals(GpsPoint)
Determines whether the specified GPS point is equal to the current GPS point.
public bool Equals(GpsPoint other)
Parameters
otherGpsPointThe GPS point to compare with the current GPS point.
Returns
- bool
True if the specified GPS point is equal to the current GPS point; otherwise, false.
FromJsonString(string)
Creates a GpsPoint instance from a JSON string.
public static GpsPoint FromJsonString(string jsonString)
Parameters
jsonStringstringThe JSON string representing the GPS point.
Returns
GetHashCode()
Returns the hash code for the current GPS point.
public override int GetHashCode()
Returns
- int
A hash code for the current GPS point.
ToString()
Returns a string representation of the GPS point.
public override string ToString()
Returns
- string
A string in the format "Latitude:Longitude:Altitude".
Operators
operator -(GpsPoint, GpsPoint)
Calculates the distance between two GPS points using the Haversine formula in kilometers.
public static double operator -(GpsPoint point1, GpsPoint point2)
Parameters
Returns
- double
The distance in kilometers, or NaN if either point is not set.