ApsGis.dll

UTM.IsValidUtmYInM(Double, Double, UtmHemisphere, UtmZone, Double, String) Method

Checks if the provided UTM Y (in meters) is valid for the user defined reference ellipsoid, i.e. if it can be used in GIS calculations in the UTM coordinate system.

public static bool IsValidUtmYInM(
   double semiMajorAxisAInM,
   double inverseFlattening,
   UtmHemisphere utmHemisphere,
   UtmZone utmZone,
   double yInM,
   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
utmHemisphere
a preferred UTM hemisphere
utmZone
a UTM zone
yInM
a UTM Y (in meters) to validate
errorMessage
an error message, passed by reference (out), that contains detailed information in case of the invalid UTM Y

Return Value

true - if the UTM Y is valid, false - if the UTM Y 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 UTM Y is a real number in the range between - MaxY and MaxY. MaxY is the function of the reference ellipsoid, the UTM hemisphere and 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.IsValidUtmYInM method from C# code:

double semiMajorAxisA = 6378137;
double inverseFlattening = 298.257223563;

string errorMessage = String.Empty;
double yInM = 1234567.98765;
UtmHemisphere utmHemisphere = UtmHemisphere.Northern;
UtmZone utmZone = UtmZone.Zone_01_from_180W_to_174W;
            
if (UTM.IsValidUtmYInM(semiMajorAxisA, inverseFlattening, utmHemisphere, utmZone, yInM, out errorMessage))
{
    Console.WriteLine("UTM Y is valid.");
}
else
{
    Console.WriteLine(errorMessage);
}

See Also

UTM Class | ApsGis Namespace | UTM.IsValidUtmYInM Overload List