Parses latitude from the provided string for the user defined reference ellipsoid and the specified UTM zone, assuming that the DegreesMinutesSecondsDirection (DMS) format is in use.
true - the function has succeeded, false - it has failed
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 valid precision is an integer number in the range from 0 (inclusive) to 15 (inclusive). The function recognizes the DegreesMinutesSecondsDirection (DMS) format, i.e. DDD MM SS.SSSS [N, S], for example: 38 53 20.9 N. The function verifies the validity of the parsed result.
This sample shows how to call the UTM.ParseLatitudeInDmsd 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 53 20.9 N";
int precision = 10;
double latInDeg = Double.NaN;
if (UTM.ParseLatitudeInDmsd(semiMajorAxisA, inverseFlattening, utmZone, str, precision, out latInDeg, out errorMessage))
{
Console.WriteLine("LatInDeg: " + latInDeg.ToString());
}
else
{
Console.WriteLine(errorMessage);
}
UTM Class | ApsGis Namespace | UTM.ParseLatitudeInDmsd Overload List