zoukankan      html  css  js  c++  java
  • List<IPoint> to IPointCollection to IPolygon

               IPointCollection 到 IPolygon的转换

                IPoint pPoint = new PointClass();
                //IPolygon pPolygon1 = new PolygonClass();
                IPointCollection pPointCollection1 = new PolygonClass();

                object _missing = Type.Missing;
                double x, y;
                for (int i = 0; i < pAllPnts.Count; i++)
                {
                    x = pAllPnts[i].X;
                    y = pAllPnts[i].Y;
                    pPoint = new PointClass();
                    pPoint.PutCoords(x, y);
                    pPointCollection1.AddPoint(pPoint, ref _missing, ref _missing);
                }
                IPolygon pPolygon = new PolygonClass();
                pPolygon = (IPolygon)pPointCollection1;

                IArea pArea;

                IFeature pFeature = pFC.CreateFeature();
                pFeature.Shape = pPolygon;
                //Abs(pArea.Area());
                pArea = (IArea)pPolygon;
                System.Windows.Forms.MessageBox.Show(pArea.Area.ToString());
                pFeature.Store();

  • 相关阅读:
    数据结构与算法4—队列
    栈的应用——括号匹配
    迷宫求解
    python的socket编程
    数据结构与算法3—栈
    数据结构与算法2—链表
    数据结构与算法1—线性表
    增量解析
    ElementTree类
    节点序列化
  • 原文地址:https://www.cnblogs.com/yuxuetaoxp/p/3259701.html
Copyright © 2011-2022 走看看