private void btnStartTransform_Click(object sender, EventArgs e) { Type factoryType = Type.GetTypeFromProgID("esriGeometry.SpatialReferenceEnvironment"); System.Object obj = Activator.CreateInstance(factoryType); ISpatialReferenceFactory2 spatialReferenceFactory2 = obj as ISpatialReferenceFactory2; IGeoTransformation geoTransformation = spatialReferenceFactory2.CreateGeoTransformation((int)esriSRGeoTransformation3Type.esriSRGeoTransformation_MGI_To_WGS_1984_3) as IGeoTransformation; //In Point (MGI_Austria_GK_East): -50545.72, 362614.3 //Out Point should be: (WGS1984 Longitude/Latitude in decimal degree): 15.649504022257, 48.3997325959545 double[] inPoints = new double[2]; double[] outPoints = new double[2]; inPoints[0] = -50545.72d; inPoints[1] = 362614.3d; geoTransformation.TransformPointsFF(esriTransformDirection.esriTransformForward, 1, ref inPoints[0], ref outPoints[0]); //Values are: -6.2468353377012207, 89.99439100965067 ???? System.Windows.Forms.MessageBox.Show("Longitude:" + outPoints[0] + ", Latitude: " + outPoints[1]); }
Solved! Go to Solution.