ApsGis.dll

Cartesian.IsValidLatitudeInDeg Method

Checks if the provided latitude (in decimal degrees) is valid, i.e. if it can be used in GIS calculations in the Cartesian coordinate system.

public static bool IsValidLatitudeInDeg(
   double latInDeg,
   out string errorMessage
);

Parameters

latInDeg
a latitude (in decimal degrees) to validate
errorMessage
an error message, passed by reference (out), that contains detailed information in case of the invalid latitude

Return Value

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

Remarks

The valid latitude is a real number in the range from -90.0 (inclusive) to 90.0 (inclusive).

Example

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

string errorMessage = String.Empty;
double latInDeg = 38.889139;
            
if (Cartesian.IsValidLatitudeInDeg(latInDeg, out errorMessage))
{
    Console.WriteLine("Latitude is valid.");
}
else
{
    Console.WriteLine(errorMessage);
}

See Also

Cartesian Class | ApsGis Namespace