ApsGis.dll

Geodetic.Latitude.IsValidDegrees Method

Checks if the provided degrees part of a latitude in DMS is valid

public static bool IsValidDegrees(
   int latDegrees,
   bool includePoles,
   out string errorMessage
);

Parameters

latDegrees
the degrees part
includePoles
include poles in the valid range
errorMessage
an error message, passed by reference (out), that contains detailed error / warning information

Return Value

true - if the degrees part is valid, false - if the degrees part is invalid

Remarks

The function verifies validity of its arguments and parsing results. The valid degrees part is an integer number in the range from 0 (inclusive) to 90 (exclusive).

Example

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

string errorMessage = String.Empty;

int degrees = 34;
bool includePoles = true;
string str = String.Empty;

if (Geodetic.Latitude.IsValidDegrees(degrees, includePoles, out errorMessage))
{
    Console.WriteLine("The degrees part is valid.");
}
else
{
    Console.WriteLine(errorMessage);
}

See Also

Latitude Class | ApsGis Namespace