Converts a longitude in DMS (degrees, minutes, seconds) to decimal degrees.
true - the function has succeeded, false - it has failed
The function verifies validity of its arguments. The valid degree part is an integer number in the range from 0 (inclusive) to 180 (inclusive). The valid minutes part is an integer number in the range from 0 (inclusive) to 60 (exclusive). The valid seconds part is a real number in the range from 0 (inclusive) to 60 (exclusive).
This sample shows how to call the Geodetic.Longitude.LonInDmsToDeg method from C# code:
string errorMessage = String.Empty;
LongitudeDirection lonDirection = LongitudeDirection.Western;
int degreesPart = 34;
int minutesPart = 45;
double secondsPart = 56.789;
double lonInDeg = Double.NaN;
if (Geodetic.Longitude.LonInDmsToDeg(degrees, minutes, seconds, lonDirection, out lonInDeg, out errorMessage))
{
Console.WriteLine("Longitude in degrees: " + lonInDeg.ToString());
}
else
{
Console.WriteLine(errorMessage);
}