Converts a Geodetic coordinate to a UTM 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 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. The valid longitude is a real number in the range from -MaxLon (exclusive) to MaxLon (exclusive). MaxLon 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.
This sample shows how to call the UTM.ConvertGeodeticToTransverseMercator method from C# code:
string errorMessage = String.Empty;
double semiMajorAxisA = 6378137;
double inverseFlattening = 298.257223563;
UtmHemisphere utmHemisphere = UtmHemisphere.Northern;
UtmZone utmZone = UtmZone.Zone_18_from_78W_to_72W;
double latInDeg = 38.889139;
double lonInDeg = -77.049;
double xInM = Double.NaN;
double yInM = Double.NaN;
if (UTM.ConvertGeodeticToUtm(semiMajorAxisAInM, inverseFlattening, utmHemisphere, utmZone, latInDeg, lonInDeg, out xInM, out yInM, out errorMessage))
{
Console.WriteLine("Conversion succeeded.");
Console.WriteLine("X, in m: " + xInM.ToString());
Console.WriteLine("Y, in m: " + yInM.ToString());
}
else
{
Console.WriteLine("Conversion failed. " + errorMessage);
}
UTM Class | ApsGis Namespace | UTM.ConvertGeodeticToUtm Overload List