ApsGis.dll

Geodetic.ParseDistanceInM Method

Parses distance (in meters) from the provided string.

public static bool ParseDistanceInM(
   string str,
   out double distanceInM,
   out string errorMessage
);

Parameters

str
a string to be parsed
distanceInM
the parsed distance, 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 the parsing result. The valid distance is a real number greater or equal to zero.

Example

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

 string errorMessage = String.Empty;
 
 string str = "78.5";
 double distanceInM = Double.NaN;

 if (Geodetic.ParseDistanceInM(str, out distanceInM, out errorMessage))
 {
     Console.WriteLine("Distance, in meters: " + distanceInDeg.ToString());
 }
 else
 {
     Console.WriteLine(errorMessage);
 }
 

See Also

Geodetic Class | ApsGis Namespace