From: http://zhihu.esrichina.com.cn/?/question/6858
Workaround ":
First create a custom geotransformation, and then use Igeometry.projectex for the projection transformation. Reference code (take wgs1984 to Xian80 as an example):
private void Func1toolstripmenuitem_click (object sender, EventArgs e) {Type t = type.gettypefromprogid ( Esrigeometry.spatialreferenceenvironment); System.Object obj = activator.createinstance (t); Ispatialreferencefactory srfact = obj as ispatialreferencefactory; Igeographiccoordinatesystem Wgs84gcs = Srfact.creategeographiccoordinatesystem ((int) Esrisrgeocstype.esrisrgeocs_ WGS1984); Iprojectedcoordinatesystem xian80pcs = Srfact.createprojectedcoordinatesystem ((int) ESRISRPROJCS4TYPE.ESRISRPROJCS _XIAN1980_3_DEGREE_GK_CM_102E); Igeotransformation Geotrans = creategeotransformation ((ispatialreference) Wgs84gcs, (ispatialreference) Xian80PCS); Iworkspacefactory WKSFAC = new Filegdbworkspacefactoryclass (); Ifeatureworkspace Feawks = Wksfac. Openfromfile (@e:test.gdb,0) as Ifeatureworkspace; Ifeatureclass FC = Feawks. Openfeatureclass (point); IFeature FEA = FC. Search (null, FALSE). Nextfeature (); IGeometry5 geometry; IPoint point = fea. Shapecopy as IPoint; Geometry = point as IGeometry5; Geometry. SpaTialreference = Wgs84gcs; Geometry. Projectex (Xian80pcs, Esritransformdirection.esritransformforward, Geotrans, False, 0.0, 0.0); Point = Geometry as IPoint; MessageBox.Show (point. X.tostring (), point. Y.tostring ()); } private Igeotransformation Creategeotransformation (ispatialreference pinputsr, ispatialreference POutputSR) { Igeotransformation Pgeotrans; Pgeotrans = new Coordinateframetransformationclass (); ((icoordinateframetransformation) Pgeotrans). Putspatialreferences (PINPUTSR, POUTPUTSR); ((icoordinateframetransformation) Pgeotrans). Putparameters (P1, p2, p3, P4, P5, P6, P7); return Pgeotrans; }
How do I convert a seven-parameter projection in the engine?