ApsGis.dll

UTM.ParseLatitudeInDeg(Double, Double, UtmZone, String, Double, String) Method

Parses latitude from the provided string for the user defined reference ellipsoid and the specified UTM zone, assuming that the DecimalDegrees (DD) format is in use.

public static bool ParseLatitudeInDeg(
   double semiMajorAxisAInM,
   double inverseFlattening,
   UtmZone utmZone,
   string str,
   out double latInDeg,
   out string errorMessage
);

Parameters

semiMajorAxisAInM
a semi major axis A (in meters) of the user defined reference ellipsoid
inverseFlattening
an inverse flattening of the user defined reference ellipsoid
utmZone
a UTM zone
str
a string to be parsed
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 before running parsing. The valid semi major axis A (in meters) is a real number greater than 0. The valid inverse flattening is a real number greater than 0. The function recognizes the DecimalDegrees (DD) format, for example: 38.889139;. The function verifies the validity of the parsed result.

Example

This sample shows how to call the UTM.ParseLatitudeInDeg method from C# code:

 string errorMessage = String.Empty;
 
 double semiMajorAxisA = 6378137;
 double inverseFlattening = 298.257223563;
 
 UtmZone utmZone = UtmZone.Zone_10_from_126W_to_120W;

 string str = "38.889139;";
 double latInDeg = Double.NaN;

 if (UTM.ParseLatitudeInDeg(semiMajorAxisA, inverseFlattening, utmZone, str, out latInDeg, out errorMessage))
 {
     Console.WriteLine("LatInDeg: " + latInDeg.ToString());
 }
 else
 {
     Console.WriteLine(errorMessage);
 }
 

See Also

UTM Class | ApsGis Namespace | UTM.ParseLatitudeInDeg Overload List