ApsGis.dll

Cartesian.ParseGeoCoordinateFormat Method

Parses / determines geodetic coordinate format in use from the provided string.

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

Parameters

str
a string to be parsed
geoCoordinateFormat
the parsed geodetic 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 is used to find the geodetic coordinate format in use: DecimalDegrees (DD) or DegreesMinutesSecondsDirection (DMS). DecimalDegrees - indicates the decimal degrees format, for example: (38.889139;, -77.049). DegreesMinutesSecondsDirection - indicates the DMS format or DDD MM SS.SSSS [N, S, E, W], for example: (38 53 20.9 N, 77 2 56.4 W).

Example

This sample shows how to call the Cartesian.ParseGeoCoordinateFormat method from C# code:

 string errorMessage = String.Empty;
 
 string str = "298.257223563";
 GeoCoordinateFormat geoCoordinateFormat = GeoCoordinateFormat.NotDefined;

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

See Also

Cartesian Class | ApsGis Namespace