ApsGis.dll

Geodetic.Latitude.ParseLatitudeDirection Method

Parses latitude direction from the provided string with a geographic coordinate.

public static bool ParseLatitudeDirection(
   string str,
   GeoCoordinateFormat geographicCoordinateFormat,
   out LatitudeDirection latDirection,
   out string errorMessage
);

Parameters

str
a string to be parsed
geographicCoordinateFormat
a geographic coordinate format used in the string
latDirection
the parsed latitude direction, 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 does not verifies if the string contains geographic coordinate in the valid format.

Example

This sample shows how to call the Geodetic.Latitude.ParseLatitudeDirection method from C# code:

string errorMessage = String.Empty;

string str = "13.7480278 N";
GeoCoordinateFormat geographicCoordinateFormat = GeoCoordinateFormat.DecimalDegrees;
LatitudeDirection latDirection = LatitudeDirection.NotDefined;

if (Geodetic.Latitude.ParseLatitudeDirection(str, geographicCoordinateFormat, out latDirection, out errorMessage))
{
    Console.WriteLine(latDirection.ToString());
}
else
{
    Console.WriteLine(errorMessage);
}

See Also

Latitude Class | ApsGis Namespace