ApsGis.dll

Mercator.IsValidLonitudeInDeg Method

Checks if the provided longitude (in decimal degrees) is valid, i.e. if it can be used in GIS calculations in the Mercator projection.

public static bool IsValidLonitudeInDeg(
   double lonInDeg,
   out string errorMessage
);

Parameters

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

Return Value

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

Remarks

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

Example

This sample shows how to call the Mercator.IsValidLongitudeInDeg method from C# code:

string errorMessage = String.Empty;
double lonInDeg = 78.0;
            
if (Mercator.IsValidLongitudeInDeg(lonInDeg, out errorMessage))
{
    Console.WriteLine("Longitude is valid.");
}
else
{
    Console.WriteLine(errorMessage);
}

See Also

Mercator Class | ApsGis Namespace