Table of Contents

Class GpsPoint

Namespace
TCSystem.MetaData
Assembly
TCSystem.MetaData.dll

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

_latitude GpsPosition?

The optional latitude.

_longitude GpsPosition?

The optional longitude.

_altitude FixedPoint32?

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

latitude GpsPosition

The latitude of the GPS point.

longitude GpsPosition

The longitude of the GPS point.

altitude float

The altitude of the GPS point in meters.

Properties

Altitude

Gets the altitude of the GPS point.

public FixedPoint32? Altitude { get; }

Property Value

FixedPoint32?

IsSet

Gets a value indicating whether both latitude and longitude are set.

public bool IsSet { get; }

Property Value

bool

Latitude

Gets the latitude of the GPS point.

public GpsPosition? Latitude { get; }

Property Value

GpsPosition?

Longitude

Gets the longitude of the GPS point.

public GpsPosition? Longitude { get; }

Property Value

GpsPosition?

Undefined

Gets an undefined GPS point.

public static GpsPoint Undefined { get; }

Property Value

GpsPoint

Methods

Equals(object)

Determines whether the specified object is equal to the current GPS point.

public override bool Equals(object obj)

Parameters

obj object

The 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

other GpsPoint

The 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

jsonString string

The JSON string representing the GPS point.

Returns

GpsPoint

A GpsPoint instance or null if the JSON string is null or empty.

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

point1 GpsPoint

The starting GPS point.

point2 GpsPoint

The ending GPS point.

Returns

double

The distance in kilometers, or NaN if either point is not set.