Skip to content

DegreesMinutesSeconds

Namespace: ThinkGeo.Core

This structure represents a degrees, minutes and seconds value.

public struct DegreesMinutesSeconds

Inheritance ObjectValueTypeDegreesMinutesSeconds

Remarks:

This structure is used in many places to represent decimal degree numbers as degrees, minutes and seconds.

Properties

Degrees

This property returns the degrees portion of the structure.

public int Degrees { get; set; }

Property Value

Int32

Remarks:

None

Minutes

This property returns the minutes portion of the structure.

public int Minutes { get; set; }

Property Value

Int32

Remarks:

None

Seconds

This property returns the seconds portion of the structure.

public double Seconds { get; set; }

Property Value

Double

Remarks:

None

Constructors

DegreesMinutesSeconds(Int32, Int32, Double)

This constructor allows you to create an instance of the class by specifying the degree, minute and second values.

DegreesMinutesSeconds(int degrees, int minutes, double seconds)

Parameters

degrees Int32
This parameter represents the degree portion of the structure.

minutes Int32
This parameter represents the minute portion of the structure.

seconds Double
This parameter represents the second portion of the structure.

Remarks:

None

Methods

GetHashCode()

Serves as hash function for the particular type.

int GetHashCode()

Returns

Int32
The hash code for this particular type.

Equals(Object)

Compares current DegreesMinutesSeconds with a passing object.

bool Equals(object obj)

Parameters

obj Object

        The passing object which will be used to compare with current
        DegreesMinutesSeconds.

Returns

Boolean
True if the passing object satisfies the following two conditions:1) The object is of DegreesMinutesSeconds type.2) The Degrees, Minutes and Seconds of both DegreesMinutesSeconds should be the same.If both conditions are not met, will return false.

Add(DegreesMinutesSeconds)

Add two DegreesMinutsSeconds together and return back a summary of the two.

DegreesMinutesSeconds Add(DegreesMinutesSeconds targetDegreesMinutesSeconds)

Parameters

targetDegreesMinutesSeconds DegreesMinutesSeconds
The target DegreesMinutesSeconds to be added together.

Returns

DegreesMinutesSeconds
The summary of the two DegreesMinutesSeconds.

ToString()

This method returns a formatted representation of the degrees, minutes and seconds value.

string ToString()

Returns

String

        This method returns a formatted representation of the degrees, minutes and seconds
        value.

Remarks:

The value will be formatted in the standard string format: 75º 21' 28"

GetFormattedString(Int32)

This method returns a formatted representation of the degrees, minutes and seconds value that has been rounded to the specified decimals.

string GetFormattedString(int decimals)

Parameters

decimals Int32

        The target decimals that the degrees, minutes, seconds value will be rounded
        to.

Returns

String

        This method returns a formatted representation of the degrees, minutes and seconds
        value.

Remarks:

The value will be formatted in the standard string format. For example, 75º 21' 2.1235" (when the decimals parameter is set to 4).

GetFormattedString(DegreesMinutesSecondsFormatType)

string GetFormattedString(DegreesMinutesSecondsFormatType formatType)

Parameters

formatType DegreesMinutesSecondsFormatType

Returns

String

GetFormattedString(DegreesMinutesSecondsFormatType, Int32)

string GetFormattedString(DegreesMinutesSecondsFormatType formatType, int decimals)

Parameters

formatType DegreesMinutesSecondsFormatType

decimals Int32

Returns

String