ApsGis.dll

Geodetic.Longitude.ParseLongitudeInDeg Method

Parses longitude from the provided string, assuming that the DecimalDegrees (DD) format is in use.

public static bool ParseLongitudeInDeg(
   string str,
   out double lonInDeg,
   out string errorMessage
);

Parameters

str
a string to be parsed
lonInDeg
the parsed longitude in decimal degrees, passed by reference (out)
errorMessage
an error message, passed by reference (out), that contains detailed error / warning information

Return Value

true - the function has succeeded, false - it has failed

Remarks

The function verifies validity of its arguments and parsing results. The function recognizes the DecimalDegrees (DD) format, for example: 38.889139;.

Example

This sample shows how to call the Geodetic.Longitude.ParseLongitudeInDeg method from C# code:

 string errorMessage = String.Empty;
 
 string str = "38.889139;";
 double lonInDeg = Double.NaN;

 if (Geodetic.Longitude.ParseLongitudeInDeg(str, out lonInDeg, out errorMessage))
 {
     Console.WriteLine("LatInDeg: " + lonInDeg.ToString());
 }
 else
 {
     Console.WriteLine(errorMessage);
 }
 

See Also

Longitude Class | ApsGis Namespace