ApsGis.dll

UTM.IsValidLatitudeInDeg(Double, Double, UtmZone, Double, String) Method

Checks if the provided latitude (in decimal degrees) 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 IsValidLatitudeInDeg(
   double semiMajorAxisAInM,
   double inverseFlattening,
   UtmZone utmZone,
   double latInDeg,
   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
utmZone
a UTM zone
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 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 latitude is a real number in the range from -MaxLat (exclusive) to MaxLat (exclusive). MaxLat is the function of the reference ellipsoid and the UTM zone. It takes into account the 40.0 km overlap with the adjacent UTM zones and 0.5 degree overlap with UPS (Univeral Polar Stereographic) projection.

Example

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

double semiMajorAxisA = 6378137;
double inverseFlattening = 298.257223563;

string errorMessage = String.Empty;
double latInDeg = 38.889139;
UtmZone utmZone = UtmZone.Zone_01_from_180W_to_174W;
            
if (UTM.IsValidLatitudeInDeg(semiMajorAxisA, inverseFlattening, utmZone, latInDeg, out errorMessage))
{
    Console.WriteLine("Latitude is valid.");
}
else
{
    Console.WriteLine(errorMessage);
}

See Also

UTM Class | ApsGis Namespace | UTM.IsValidLatitudeInDeg Overload List