ApsGis.dll

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

Checks if the provided TM X (in meters) is valid for the user defined reference ellipsoid, i.e. if it can be used in GIS calculations in the TM coordinate system.

public static bool IsValidTmXInM(
   double semiMajorAxisAInM,
   double inverseFlattening,
   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
xInM
a TM X (in meters) to validate
errorMessage
an error message, passed by reference (out), that contains detailed information in case of the invalid TM X

Return Value

true - if the TM X is valid, false - if the TM X is invalid

Remarks

The function checks validity of its arguments. 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 between - MaxX (inclusive) and MaxX (inclusive). MaxX is the function of the reference ellipsoid.

Example

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

double semiMajorAxisA = 6378137;
double inverseFlattening = 298.257223563;

string errorMessage = String.Empty;
double xInM = 1234567.98765;
            
if (TM.IsValidTmXInM(semiMajorAxisA, inverseFlattening, xInM, out errorMessage))
{
    Console.WriteLine("TM X is valid.");
}
else
{
    Console.WriteLine(errorMessage);
}

See Also

TM Class | ApsGis Namespace | TM.IsValidTmXInM Overload List