Converts a Mercator coordinate to a Geodetic coordinate on the user defined reference ellipsoid.
true - if the conversion succeeded, false - if the conversion failed
The function verifies validity of the input arguments before running the conversion. 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 central meridian is a real number in the range from -180.0 (inclusive) to 180.0 (inclusive). The valid Mercator X is a real number. The valid Mercator Y is a real number.
This sample shows how to call the Mercator.ConvertMercatorToGeodetic method from C# code:
string errorMessage = String.Empty;
double semiMajorAxisA = 6378137;
double inverseFlattening = 298.257223563;
double cmInDeg = -70.5;
double xInM = -729031.34520515;
double yInM = 4678974.22718545;
double latInDeg = Double.NaN;
double lonInDeg = Double.NaN;
if (Mercator.ConvertMercatorToGeodetic(semiMajorAxisAInM, inverseFlattening, cmInDeg, xInM, yInM, out latInDeg, out lonInDeg, out errorMessage))
{
Console.WriteLine("Conversion succeeded.");
Console.WriteLine("LatInDeg: " + latInDeg.ToString());
Console.WriteLine("LonInDeg: " + lonInDeg.ToString());
}
else
{
Console.WriteLine("Conversion failed. " + errorMessage);
}
Mercator Class | ApsGis Namespace | Mercator.ConvertMercatorToGeodetic Overload List