/// <summary>
        /// create a crazy coordinate system
        /// </summary>
        /// <returns></returns>
        private ISpatialReference CreateGeographicSpatialReference()
        {
            ISpatialReferenceFactory    spatialRefFatcory = new SpatialReferenceEnvironmentClass();
            IGeographicCoordinateSystem geoCoordSys;

            geoCoordSys = spatialRefFatcory.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_WGS1984);

            //assign a user defined datum to the SR (just for the test)
            IDatum     datum     = new DatumClass();
            IDatumEdit datumEdit = (IDatumEdit)datum;
            ISpheroid  spheroid  = spatialRefFatcory.CreateSpheroid((int)esriSRSpheroidType.esriSRSpheroid_Clarke1880);

            datumEdit.DefineEx("MyDatum", "My Datum", "MDTM", "", spheroid);

            IPrimeMeridian primeMeridian = spatialRefFatcory.CreatePrimeMeridian((int)esriSRPrimeMType.esriSRPrimeM_Greenwich);
            IAngularUnit   angularUnits  = spatialRefFatcory.CreateUnit((int)esriSRUnitType.esriSRUnit_Degree) as IAngularUnit;
            IGeographicCoordinateSystemEdit geoCoordSysEdit = (IGeographicCoordinateSystemEdit)geoCoordSys;

            geoCoordSysEdit.DefineEx("MyGeoCoordSys", "MyGeoCoordSys", "MGCS", "", "", datum, primeMeridian, angularUnits);

            geoCoordSys.SetFalseOriginAndUnits(-180.0, -180.0, 5000000.0);
            geoCoordSys.SetZFalseOriginAndUnits(0.0, 100000.0);
            geoCoordSys.SetMFalseOriginAndUnits(0.0, 100000.0);

            return(geoCoordSys as ISpatialReference);
        }
        private void  createProjectedCoordinateSystem()
        {
            ISpatialReferenceFactory2   spatialReferenceFactory = new SpatialReferenceEnvironmentClass();
            IProjectionGEN              projection = spatialReferenceFactory.CreateProjection((int)esriSRProjectionType.esriSRProjection_Sinusoidal) as IProjectionGEN;
            IGeographicCoordinateSystem geographicCoordinateSystem = spatialReferenceFactory.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_WGS1984);
            ILinearUnit unit = spatialReferenceFactory.CreateUnit((int)esriSRUnitType.esriSRUnit_Meter) as ILinearUnit;

            IParameter[] parameters = projection.GetDefaultParameters();
            IProjectedCoordinateSystemEdit projectedCoordinateSystemEdit = new ProjectedCoordinateSystemClass();

            object name = "Newfoundland"; object alias = "NF_LAB";
            object abbreviation = "NF";
            object remarks      = "Most Eastern Province in Canada";
            object usage        = "When making maps of Newfoundland";
            object geographicCoordinateSystemObject = geographicCoordinateSystem as object;
            object unitObject       = unit as object;
            object projectionObject = projection as object;
            object parametersObject = parameters as object;

            projectedCoordinateSystemEdit.Define(ref name, ref alias, ref abbreviation, ref remarks, ref usage, ref geographicCoordinateSystemObject, ref unitObject, ref projectionObject, ref parametersObject);
            IProjectedCoordinateSystem userDefinedProjectedCoordinateSystem = projectedCoordinateSystemEdit as IProjectedCoordinateSystem;

            m_map.SpatialReference = userDefinedProjectedCoordinateSystem;
            m_activeView.Refresh();
            MessageBox.Show("自定义ProjectedCoordinateSystem完成!");
        }
        private void createVerticalCoordinateSystem()
        {
            ISpatialReferenceFactory3 spatialReferenceFactory = new SpatialReferenceEnvironmentClass();
            IVerticalDatum            verticalDatum           = spatialReferenceFactory.CreateVerticalDatum((int)esriSRVerticalDatumType.esriSRVertDatum_Taranaki);
            IHVDatum    hvDatum    = verticalDatum as IHVDatum;
            ILinearUnit linearUnit = spatialReferenceFactory.CreateUnit((int)esriSRUnitType.esriSRUnit_Meter) as ILinearUnit;
            IVerticalCoordinateSystemEdit verticalCoordinateSystemEdit = new VerticalCoordinateSystemClass();
            object name              = "New VCoordinateSystem";
            object alias             = "VCoordinateSystem alias";
            object abbreviation      = "abbr";
            object remarks           = "Test for options";
            object usage             = "New Zealand";
            object hvDatumObject     = hvDatum as object;
            object unitObject        = linearUnit as object;
            object verticalShift     = 40 as object;
            object positiveDirection = -1 as object;

            verticalCoordinateSystemEdit.Define(ref name, ref alias, ref abbreviation, ref remarks, ref usage, ref hvDatumObject, ref unitObject, ref verticalShift, ref positiveDirection);
            IVerticalCoordinateSystem verticalCoordinateSystem = verticalCoordinateSystemEdit as IVerticalCoordinateSystem;


            m_map.SpatialReference = verticalCoordinateSystem as ISpatialReference;
            m_activeView.Refresh();
            MessageBox.Show("自定义verticalCoordinateSystem完成!");
        }
Exemplo n.º 4
0
        private void  CreateGeographicCoordinateSystem()
        {
            ISpatialReferenceFactory3 spatialReferenceFactory = new SpatialReferenceEnvironmentClass();
            IDatum         datum         = spatialReferenceFactory.CreateDatum((int)esriSRDatumType.esriSRDatum_OSGB1936);
            IPrimeMeridian primeMeridian = spatialReferenceFactory.CreatePrimeMeridian((int)esriSRPrimeMType.esriSRPrimeM_Greenwich);
            IUnit          unit          = spatialReferenceFactory.CreateUnit((int)esriSRUnitType.esriSRUnit_Degree);
            IGeographicCoordinateSystemEdit geographicCoordinateSystemEdit = new GeographicCoordinateSystemClass();
            object name                = "UserDefined Geographic Coordinate System";
            object alias               = "UserDefined GCS";
            object abbreviation        = "UserDefined";
            object remarks             = "User Defined Geographic Coordinate System based on OSGB1936";
            object usage               = "Suitable for the UK";
            object datumObject         = datum as object;
            object primeMeridianObject = primeMeridian as object;
            object unitObject          = unit as object;

            geographicCoordinateSystemEdit.Define(ref name, ref alias, ref abbreviation, ref remarks, ref usage, ref datumObject, ref primeMeridianObject, ref unitObject);
            IGeographicCoordinateSystem userDefinedGeographicCoordinateSystem = geographicCoordinateSystemEdit as IGeographicCoordinateSystem;


            m_map.SpatialReference = userDefinedGeographicCoordinateSystem;
            m_activeView.Refresh();
            MessageBox.Show("已将当前坐标系统转换为自定义GeographicCoordinateSystem!");
        }
Exemplo n.º 5
0
        //将任意坐标系统转换为自定义Albers大地坐标(米)
        public static IPoint GeoToGra(IPoint point)
        {
            IPoint pt = new PointClass();
            pt.PutCoords(point.X, point.Y);

            ISpatialReferenceFactory2 pFact = new SpatialReferenceEnvironmentClass();

            //定义地理坐标,由输入的对象决定,也可以自己定义,参考: esriSRGeoCSType
            IGeographicCoordinateSystem pGCS = new GeographicCoordinateSystemClass();
            pGCS = pFact.CreateGeographicCoordinateSystem(point.SpatialReference.FactoryCode);

            //自定义投影方式
            IProjectedCoordinateSystem pProjectedCS = new ProjectedCoordinateSystemClass();
            IProjectedCoordinateSystemEdit pProjectedCSEdit = pProjectedCS as IProjectedCoordinateSystemEdit;

            //定义投影方式,参考: esriSRProjectionType
            IProjection pProjection = new ProjectionClass();
            pProjection = pFact.CreateProjection((int)esriSRProjectionType.esriSRProjection_Albers);

            //定义投影单位,参考:esriSRUnitType
            ILinearUnit pUnit = new LinearUnitClass();
            pUnit = pFact.CreateUnit((int)esriSRUnitType.esriSRUnit_Meter) as ILinearUnit;

            //定义其他参数,参考:esriSRParameterType
            IParameter[] pParm = new IParameter[6];
            pParm[0] = pFact.CreateParameter((int)esriSRParameterType.esriSRParameter_FalseEasting);
            pParm[0].Value = 0;

            pParm[1] = pFact.CreateParameter((int)esriSRParameterType.esriSRParameter_FalseNorthing);
            pParm[1].Value = 0;

            pParm[2] = pFact.CreateParameter((int)esriSRParameterType.esriSRParameter_CentralMeridian);
            pParm[2].Value = 110;

            pParm[3] = pFact.CreateParameter((int)esriSRParameterType.esriSRParameter_StandardParallel1);
            pParm[3].Value = 25;

            pParm[4] = pFact.CreateParameter((int)esriSRParameterType.esriSRParameter_StandardParallel2);
            pParm[4].Value = 47;

            pParm[5] = pFact.CreateParameter((int)esriSRParameterType.esriSRParameter_LatitudeOfOrigin);
            pParm[5].Value = 0;

            //设置投影相关信息
            object name = "User_Defined_Albers";
            object alias = "Albers";
            object abbreviation = "Albers";
            object remarks = "User_Defined_Albers is the projection";
            object usage = "";
            object gcs = pGCS;
            object projectedUnit = pUnit;
            object projection = pProjection;
            object parameters = pParm;
            pProjectedCSEdit.Define(ref name, ref alias, ref abbreviation, ref remarks, ref usage, ref gcs, ref projectedUnit, ref projection, ref parameters);

            //获取自定义空间参考
            ISpatialReference pSpatialRef = pProjectedCS as ISpatialReference;

            IGeometry pGeometry = (IGeometry)pt;
            pGeometry.SpatialReference = pGCS as ISpatialReference;

            //重投影处理
            pGeometry.Project(pSpatialRef);

            return pt;
        }
Exemplo n.º 6
0
        private void btOK_Click(object sender, EventArgs e)
        {
            try
            {
                string        pPointFileName   = cboBoxPointLayer.SelectedItem.ToString();
                string        pCenterlinName   = comboBoxExCenterlineLinearLayer.SelectedItem.ToString();
                IFeatureLayer pPointLayer      = null;
                IFeatureLayer pCenterlineLayer = null;
                for (int i = 0; i < pMapcontrol.LayerCount; i++)
                {
                    if (pPointFileName == pMapcontrol.get_Layer(i).Name)
                    {
                        pPointLayer = pMapcontrol.get_Layer(i) as IFeatureLayer;
                    }
                    if (pCenterlinName == pMapcontrol.get_Layer(i).Name)
                    {
                        pCenterlineLayer = pMapcontrol.get_Layer(i) as IFeatureLayer;
                    }
                }
                IFeatureClass  pLineFC      = pCenterlineLayer.FeatureClass;
                IFeatureClass  pPointFC     = pPointLayer.FeatureClass;
                IFeatureCursor pLineCursor  = pLineFC.Search(null, false);
                IFeature       pLineFeature = pLineCursor.NextFeature();
                IQueryFilter   qf1          = null;
                DataTable      ptable;

                if (radioButtonLayer.Checked)
                {
                    ptable = AOFunctions.GDB.ITableUtil.GetDataTableFromITable(pPointFC as ITable, qf1);
                }
                else
                {
                    string          strCon = " Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source = " + this.textBoxFile.Text + ";Extended Properties=Excel 8.0";
                    OleDbConnection conn   = new OleDbConnection(strCon);
                    string          sql1   = "select * from [Sheet1$]";
                    conn.Open();
                    OleDbDataAdapter myCommand = new OleDbDataAdapter(sql1, strCon);
                    DataSet          ds        = new DataSet();
                    myCommand.Fill(ds);
                    conn.Close();
                    ptable = ds.Tables[0];
                    if (ptable.Columns.Contains(EvConfig.IMUMoveDistanceField))
                    {
                        ptable.Columns[EvConfig.IMUMoveDistanceField].DataType = System.Type.GetType("System.Double");
                    }
                }


                if (!ptable.Columns.Contains("X"))
                {
                    ptable.Columns.Add("X", System.Type.GetType("System.Double"));
                }
                if (!ptable.Columns.Contains("Y"))
                {
                    ptable.Columns.Add("Y", System.Type.GetType("System.Double"));
                }
                if (!ptable.Columns.Contains("Z"))
                {
                    ptable.Columns.Add("Z", System.Type.GetType("System.Double"));
                }
                if (!ptable.Columns.Contains("对齐里程"))
                {
                    ptable.Columns.Add("对齐里程", System.Type.GetType("System.Double"));
                }
                if (!ptable.Columns.Contains("距离偏移"))
                {
                    ptable.Columns.Add("距离偏移", System.Type.GetType("System.Double"));
                }
                ISpatialReferenceFactory spatialReferenceFactory = new SpatialReferenceEnvironmentClass();
                //wgs 84
                IGeographicCoordinateSystem wgs84 = spatialReferenceFactory.CreateGeographicCoordinateSystem(4326) as IGeographicCoordinateSystem;
                IUnit meterUnit = spatialReferenceFactory.CreateUnit((int)ESRI.ArcGIS.Geometry.esriSRUnitType.esriSRUnit_Meter);

                IPolyline pline = pLineFeature.Shape as IPolyline;
                pline.SpatialReference = wgs84;

                IProximityOperator pPO = pline as IProximityOperator;

                int idx = 0;
                for (int i = 0; i < ptable.Rows.Count; i++)
                {
                    try
                    {
                        DataRow r  = ptable.Rows[i];
                        IPoint  pt = new PointClass();
                        pt.X = Convert.ToDouble(r[EvConfig.WeldXField]);
                        pt.Y = Convert.ToDouble(r[EvConfig.WeldYField]);
                        pt.SpatialReference = wgs84;
                        IPoint ptInLine = pPO.ReturnNearestPoint(pt, esriSegmentExtension.esriNoExtension);
                        r["X"]    = ptInLine.X;
                        r["Y"]    = ptInLine.Y;
                        r["对齐里程"] = ptInLine.M;
                        r["Z"]    = ptInLine.Z;

                        r["距离偏移"] = Math.Round(DataAlignment.DataAlignment.CalculateDistanceBetween84TwoPoints(pt, ptInLine), 2);
                    }
                    catch
                    {
                    }
                }
                System.Runtime.InteropServices.Marshal.ReleaseComObject(spatialReferenceFactory);
                System.Runtime.InteropServices.Marshal.ReleaseComObject(pLineCursor);


                FrmIMUAlignmentresult frm = new FrmIMUAlignmentresult(ptable);
                frm.setResultType("焊缝对齐报告");
                frm.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    /// <summary>
    /// create a crazy coordinate system
    /// </summary>
    /// <returns></returns>
    private ISpatialReference CreateGeographicSpatialReference()
    {
      ISpatialReferenceFactory spatialRefFatcory = new SpatialReferenceEnvironmentClass();
      IGeographicCoordinateSystem geoCoordSys;
      geoCoordSys = spatialRefFatcory.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_WGS1984);

      //assign a user defined datum to the SR (just for the test)
      IDatum datum = new DatumClass();
      IDatumEdit datumEdit = (IDatumEdit)datum;
      ISpheroid spheroid = spatialRefFatcory.CreateSpheroid((int)esriSRSpheroidType.esriSRSpheroid_Clarke1880);
      datumEdit.DefineEx("MyDatum", "My Datum", "MDTM", "", spheroid);

      IPrimeMeridian primeMeridian = spatialRefFatcory.CreatePrimeMeridian((int)esriSRPrimeMType.esriSRPrimeM_Greenwich);
      IAngularUnit angularUnits = spatialRefFatcory.CreateUnit((int)esriSRUnitType.esriSRUnit_Degree) as IAngularUnit;
      IGeographicCoordinateSystemEdit geoCoordSysEdit = (IGeographicCoordinateSystemEdit)geoCoordSys;
      geoCoordSysEdit.DefineEx("MyGeoCoordSys", "MyGeoCoordSys", "MGCS", "", "", datum, primeMeridian, angularUnits);

      geoCoordSys.SetFalseOriginAndUnits(-180.0, -180.0, 5000000.0);
      geoCoordSys.SetZFalseOriginAndUnits(0.0, 100000.0);
      geoCoordSys.SetMFalseOriginAndUnits(0.0, 100000.0);

      return geoCoordSys as ISpatialReference;
    }
        private void btOK_Click(object sender, EventArgs e)
        {
            string        pPointFileName   = cboBoxPointLayer.SelectedItem.ToString();
            string        pCenterlinName   = comboBoxExCenterlineLayer.SelectedItem.ToString();
            IFeatureLayer pPointLayer      = null;
            IFeatureLayer pCenterlineLayer = null;

            for (int i = 0; i < pMapcontrol.LayerCount; i++)
            {
                if (pPointFileName == pMapcontrol.get_Layer(i).Name)
                {
                    pPointLayer = pMapcontrol.get_Layer(i) as IFeatureLayer;
                }
                if (pCenterlinName == pMapcontrol.get_Layer(i).Name)
                {
                    pCenterlineLayer = pMapcontrol.get_Layer(i) as IFeatureLayer;
                }
            }
            IFeatureClass  pLineFC      = pCenterlineLayer.FeatureClass;
            IFeatureClass  pPointFC     = pPointLayer.FeatureClass;
            IQueryFilter   pQF          = null;
            IFeatureCursor pLineCursor  = pLineFC.Search(null, false);
            IFeatureCursor pPointCursor = pPointFC.Search(null, false);
            IFeature       pLineFeature = pLineCursor.NextFeature();
            DataTable      ptTable      = AOFunctions.GDB.ITableUtil.GetDataTableFromITable(pPointFC as ITable, pQF);

            ptTable.Columns.Add("长度");
            ptTable.Columns.Add("距离");
            ptTable.Columns.Add("中间点坐标");
            if (pLineFeature != null)
            {
                ISpatialReferenceFactory spatialReferenceFactory = new SpatialReferenceEnvironmentClass();
                //wgs 84
                IGeographicCoordinateSystem wgs84 = spatialReferenceFactory.CreateGeographicCoordinateSystem(4326) as IGeographicCoordinateSystem;
                IUnit     meterUnit = spatialReferenceFactory.CreateUnit((int)ESRI.ArcGIS.Geometry.esriSRUnitType.esriSRUnit_Meter);
                IPolyline pline     = pLineFeature.Shape as IPolyline;
                pline.SpatialReference = wgs84;

                IProximityOperator pPO       = pline as IProximityOperator;
                IFeature           ptFeature = pPointCursor.NextFeature();
                int idx = 0;
                System.Runtime.InteropServices.Marshal.ReleaseComObject(spatialReferenceFactory);
                while (ptFeature != null)
                {
                    DataRow row = ptTable.Rows[idx];
                    IPoint  pt  = ptFeature.Shape as IPoint;
                    pt.SpatialReference = wgs84;
                    IPoint nearestpt = pPO.ReturnNearestPoint(pt, esriSegmentExtension.esriNoExtension);
                    double distance  = DataAlignment.DataAlignment.CalculateDistanceBetween84TwoPoints(pt, nearestpt);
                    // = pPO.ReturnDistance(pt);

                    row["距离"] = distance;
                    if (idx == 0)
                    {
                        row["长度"] = 0;
                    }
                    else
                    {
                        DataRow preRow = ptTable.Rows[idx - 1];
                        row["长度"] = Convert.ToDouble(row[EvConfig.IMUMoveDistanceField]) - Convert.ToDouble(preRow[EvConfig.IMUMoveDistanceField]);
                    }
                    ptFeature = pPointCursor.NextFeature();
                    idx++;
                }
                System.Runtime.InteropServices.Marshal.ReleaseComObject(spatialReferenceFactory);
            }


            DataTable dt2 = new DataTable();

            dt2.Columns.Add("名称");
            dt2.Columns.Add("长度");
            dt2.Columns.Add("比例");

            //  List<DataRow> rowlist = (dt2.Rows.Where(e => Convert.ToDouble(e["距离"]) <= 2)).ToList();

            List <DataRow> less1 = (from DataRow r in ptTable.Rows
                                    where Convert.ToDouble(r["距离"]) <= 1
                                    select r).ToList();
            double length1 = less1.Sum(x => Convert.ToDouble(x["长度"]));
            int    sum1    = less1.Count;

            List <DataRow> Great2 = (from DataRow r in ptTable.Rows
                                     where Convert.ToDouble(r["距离"]) > 2
                                     select r).ToList();
            double length2 = Great2.Sum(x => Convert.ToDouble(x["长度"]));
            int    sum2    = Great2.Count;

            List <DataRow> Medium2 = (from DataRow r in ptTable.Rows
                                      where Convert.ToDouble(r["距离"]) > 1 && Convert.ToDouble(r["距离"]) <= 2
                                      select r).ToList();
            double length3 = Medium2.Sum(x => Convert.ToDouble(x["长度"]));
            int    sum3    = Medium2.Count;

            DataRow r1;

            r1    = dt2.Rows.Add();
            r1[0] = "≤1米";
            r1[1] = length1;
            r1[2] = 1.0 * sum1 / (sum1 + sum2 + sum3);

            r1    = dt2.Rows.Add();
            r1[0] = ">1米且≤2米";
            r1[1] = length3;
            r1[2] = 1.0 * sum3 / (sum1 + sum2 + sum3);


            r1    = dt2.Rows.Add();
            r1[0] = "大于2米";
            r1[1] = length2;
            r1[2] = 1.0 * sum2 / (sum1 + sum2 + sum3);


            List <DataTable> tablelist = new List <DataTable>();

            tablelist.Add(ptTable);
            tablelist.Add(dt2);

            FRMInsideInspectionReport frm = new FRMInsideInspectionReport(tablelist);

            frm.ShowDialog();
        }
Exemplo n.º 9
0
        //将任意坐标系统转换为自定义Albers大地坐标(米)
        public static IPoint GeoToGra(IPoint point)
        {
            IPoint pt = new PointClass();

            pt.PutCoords(point.X, point.Y);

            ISpatialReferenceFactory2 pFact = new SpatialReferenceEnvironmentClass();

            //定义地理坐标,由输入的对象决定,也可以自己定义,参考: esriSRGeoCSType
            IGeographicCoordinateSystem pGCS = new GeographicCoordinateSystemClass();

            pGCS = pFact.CreateGeographicCoordinateSystem(point.SpatialReference.FactoryCode);

            //自定义投影方式
            IProjectedCoordinateSystem     pProjectedCS     = new ProjectedCoordinateSystemClass();
            IProjectedCoordinateSystemEdit pProjectedCSEdit = pProjectedCS as IProjectedCoordinateSystemEdit;

            //定义投影方式,参考: esriSRProjectionType
            IProjection pProjection = new ProjectionClass();

            pProjection = pFact.CreateProjection((int)esriSRProjectionType.esriSRProjection_Albers);

            //定义投影单位,参考:esriSRUnitType
            ILinearUnit pUnit = new LinearUnitClass();

            pUnit = pFact.CreateUnit((int)esriSRUnitType.esriSRUnit_Meter) as ILinearUnit;

            //定义其他参数,参考:esriSRParameterType
            IParameter[] pParm = new IParameter[6];
            pParm[0]       = pFact.CreateParameter((int)esriSRParameterType.esriSRParameter_FalseEasting);
            pParm[0].Value = 0;

            pParm[1]       = pFact.CreateParameter((int)esriSRParameterType.esriSRParameter_FalseNorthing);
            pParm[1].Value = 0;

            pParm[2]       = pFact.CreateParameter((int)esriSRParameterType.esriSRParameter_CentralMeridian);
            pParm[2].Value = 110;

            pParm[3]       = pFact.CreateParameter((int)esriSRParameterType.esriSRParameter_StandardParallel1);
            pParm[3].Value = 25;

            pParm[4]       = pFact.CreateParameter((int)esriSRParameterType.esriSRParameter_StandardParallel2);
            pParm[4].Value = 47;

            pParm[5]       = pFact.CreateParameter((int)esriSRParameterType.esriSRParameter_LatitudeOfOrigin);
            pParm[5].Value = 0;

            //设置投影相关信息
            object name          = "User_Defined_Albers";
            object alias         = "Albers";
            object abbreviation  = "Albers";
            object remarks       = "User_Defined_Albers is the projection";
            object usage         = "";
            object gcs           = pGCS;
            object projectedUnit = pUnit;
            object projection    = pProjection;
            object parameters    = pParm;

            pProjectedCSEdit.Define(ref name, ref alias, ref abbreviation, ref remarks, ref usage, ref gcs, ref projectedUnit, ref projection, ref parameters);

            //获取自定义空间参考
            ISpatialReference pSpatialRef = pProjectedCS as ISpatialReference;

            IGeometry pGeometry = (IGeometry)pt;

            pGeometry.SpatialReference = pGCS as ISpatialReference;

            //重投影处理
            pGeometry.Project(pSpatialRef);

            return(pt);
        }