ApsGis.dll

Geodetic.IsValidDistanceInM Method

Checks if the provided distance is valid, i.e. if it can be used in GIS calculations in the Geodetic coordinate system.

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

Parameters

distanceInM
a distance to validate
errorMessage
an error message, passed by reference (out), that contains detailed information in case of the invalid distance

Return Value

true - if the distance is valid, false - if the distance is invalid

Remarks

The valid distance is a real number greater or equal to zero.

Example

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

string errorMessage = String.Empty;
double distanceInM = 100;
            
if (Geodetic.IsValidDistanceInM(distanceInM, out errorMessage))
{
    Console.WriteLine("Distance is valid.");
}
else
{
    Console.WriteLine(errorMessage);
}

See Also

Geodetic Class | ApsGis Namespace