ApsGis.dll

TM.IsValidRange Method

Checks if the provided geographic coordinate (latitude and longitude in decimal degrees) is valid for TM projection with the central meridian, i.e. if it can be used in GIS calculations in the TM coordinate system.

public static bool IsValidRange(
   double latInDeg,
   double lonInDeg,
   double cmInDeg,
   out string errorMessage
);

Parameters

latInDeg
a latitude in decimal degrees
lonInDeg
a longitude (in decimal degrees)
cmInDeg
a central meridian (in decimal degrees)
errorMessage
an error message, passed by reference (out), that contains detailed error information

Return Value

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

Example

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

string errorMessage = String.Empty;
double latInDeg = 38.889139;
double lonInDeg = -120.123475;
double cmInDeg = -54.0;
            
if (TM.IsValidRange(latInDeg, lonInDeg, cmInDeg, out errorMessage))
{
    Console.WriteLine("Latitude is valid.");
}
else
{
    Console.WriteLine(errorMessage);
}

See Also

TM Class | ApsGis Namespace