ApsGis.dll

Geodetic.Latitude.ParseLatitudeInDeg Method

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

public static bool ParseLatitudeInDeg(
   string str,
   bool includePoles,
   out double latInDeg,
   out string errorMessage
);

Parameters

str
a string to be parsed
includePoles
include poles in the valid range
latInDeg
the parsed latitude 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.Latitude.ParseLatitudeInDeg method from C# code:

 string errorMessage = String.Empty;
 
 string str = "38.889139;";
 bool includePoles = true;
 double latInDeg = Double.NaN;

 if (Geodetic.Latitude.ParseLatitudeInDeg(str, includePoles, out latInDeg, out errorMessage))
 {
     Console.WriteLine("LatInDeg: " + latInDeg.ToString());
 }
 else
 {
     Console.WriteLine(errorMessage);
 }
 

See Also

Latitude Class | ApsGis Namespace