ApsGis.dll

TM.ParseTmXInM(Double, Double, String, Double, String) Method

Parses TM X from the provided string for the user defined reference ellipsoid.

public static bool ParseTmXInM(
   double semiMajorAxisAInM,
   double inverseFlattening,
   string str,
   out double xInM,
   out string errorMessage
);

Parameters

semiMajorAxisAInM
a semi major axis A (in meters) of the user defined reference ellipsoid
inverseFlattening
an inverse flattening of the user defined reference ellipsoid
str
a string to be parsed
xInM
the parsed TM X, 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 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 TM X is a real number in the range from -MaxX (inclusive) and MaxX (inclusive). MaxLat is the function of the reference ellipsoid.

Example

This sample shows how to call the TM.ParseTmXInM method from C# code:

 string errorMessage = String.Empty;
 
 double semiMajorAxisA = 6378137;
 double inverseFlattening = 298.257223563;
 
 string str = "1114120.60285998";
 double xInM = Double.NaN;

 if (TM.ParseTmXInM(semiMajorAxisA, inverseFlattening, str, out xInM, out errorMessage))
 {
     Console.WriteLine("X, in m: " + xInM.ToString());
 }
 else
 {
     Console.WriteLine(errorMessage);
 }
 

See Also

TM Class | ApsGis Namespace | TM.ParseTmXInM Overload List