Table of Contents

Struct GpsPosition

Namespace
TCSystem.MetaData
Assembly
TCSystem.MetaData.dll

Represents a signed geographic coordinate in degrees, minutes, seconds, and ten-thousandths of a second.

public readonly struct GpsPosition : IEquatable<GpsPosition>
Implements
Inherited Members

Constructors

GpsPosition(int, int, int, int, bool)

Represents a signed geographic coordinate in degrees, minutes, seconds, and ten-thousandths of a second.

public GpsPosition(int _degrees, int _minutes, int _seconds, int _subSeconds, bool _negative)

Parameters

_degrees int

The absolute whole degrees.

_minutes int

The whole minutes.

_seconds int

The whole seconds.

_subSeconds int

The ten-thousandths of a second.

_negative bool

Whether the coordinate is negative.

Properties

Degrees

Gets the absolute whole degrees.

public int Degrees { get; }

Property Value

int

Minutes

Gets the whole minutes.

public int Minutes { get; }

Property Value

int

Negative

Gets whether the coordinate is negative.

public bool Negative { get; }

Property Value

bool

Seconds

Gets the whole seconds.

public int Seconds { get; }

Property Value

int

SubSeconds

Gets the ten-thousandths of a second.

public int SubSeconds { get; }

Property Value

int

Methods

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

Equals(GpsPosition)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(GpsPosition other)

Parameters

other GpsPosition

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

FromDoublePosition(double)

Creates a coordinate from signed decimal degrees.

public static GpsPosition FromDoublePosition(double coordinate)

Parameters

coordinate double

The coordinate in decimal degrees.

Returns

GpsPosition

The converted coordinate.

FromJsonString(string)

Deserializes a coordinate from JSON.

public static GpsPosition? FromJsonString(string jsonString)

Parameters

jsonString string

The JSON object to deserialize.

Returns

GpsPosition?

The coordinate, or null for null or empty input.

FromString(string)

Parses the period-delimited representation returned by ToString().

public static GpsPosition? FromString(string val)

Parameters

val string

The coordinate text.

Returns

GpsPosition?

The parsed coordinate, or null when the format is not recognized.

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.

ToDouble()

Converts the coordinate to signed decimal degrees.

public double ToDouble()

Returns

double

The coordinate in decimal degrees.

ToString()

Formats the coordinate as degrees, minutes, seconds, and subseconds separated by periods.

public override string ToString()

Returns

string

The formatted coordinate.

Operators

operator +(GpsPosition, GpsPosition)

Adds two coordinates in decimal-degree space.

public static GpsPosition operator +(GpsPosition pos1, GpsPosition pos2)

Parameters

pos1 GpsPosition
pos2 GpsPosition

Returns

GpsPosition

operator ==(GpsPosition, GpsPosition)

Determines whether two coordinates are equal.

public static bool operator ==(GpsPosition lhs, GpsPosition rhs)

Parameters

lhs GpsPosition
rhs GpsPosition

Returns

bool

operator !=(GpsPosition, GpsPosition)

Determines whether two coordinates are not equal.

public static bool operator !=(GpsPosition lhs, GpsPosition rhs)

Parameters

lhs GpsPosition
rhs GpsPosition

Returns

bool

operator -(GpsPosition, GpsPosition)

Subtracts the second coordinate from the first in decimal-degree space.

public static GpsPosition operator -(GpsPosition pos1, GpsPosition pos2)

Parameters

pos1 GpsPosition
pos2 GpsPosition

Returns

GpsPosition