ApsGis.dll

Geodetic.Longitude.ParseGeoCoordinateFormat Method

Parses / determines the geographic coordinate format used in the specified string.

public static bool ParseGeoCoordinateFormat(
   string str,
   out GeoCoordinateFormat geoCoordinateFormat,
   out string errorMessage
);

Parameters

str
a string to be parsed
geoCoordinateFormat
the parsed geographic coordinate format, 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.Longitude.ParseGeoCoordinateFormat method from C# code:

string errorMessage = String.Empty;

string str = "13.7480278 W";
GeoCoordinateFormat geoCoordinateFormat = GeoCoordinateFormat.NotDefined;

if (Geodetic.Longitude.ParseGeoCoordinateFormat(str, out geoCoordinateFormat, out errorMessage))
{
    Console.WriteLine(geoCoordinateFormat.ToString());
}
else
{
    Console.WriteLine(errorMessage);
}

See Also

Longitude Class | ApsGis Namespace