コード例 #1
0
        /// <summary>
        /// 由点坐标创建面对象
        /// </summary>
        /// <param name="pnts">点集合</param>
        /// <returns>返回的面对象</returns>
        public IPolygon CreatePolygonFromPnts(IList <IPoint> pnts, ISpatialReference spr)
        {
            IPolygon            polygon = new PolygonClass();
            INewPolygonFeedback fac     = new NewPolygonFeedbackClass();

            polygon.SpatialReference = spr;
            IPointCollection pntcols = polygon as IPointCollection;

            for (int i = 0; i < pnts.Count; i++)
            {
                pntcols.AddPoint(pnts[i]);
            }
            if (!polygon.IsClosed)
            {
                polygon.Close();
            }
            //polygon.Close();
            return(polygon);
        }
コード例 #2
0
        /// <summary>
        /// 由点坐标创建面对象
        /// </summary>
        /// <params name="pnts">点集合</params>
        /// <returns>返回的面对象</returns>
        public IPolygon CreatePolygonFromPnts(IList<IPoint> pnts, ISpatialReference spr)
        {
            IPolygon polygon = new PolygonClass();
            INewPolygonFeedback fac = new NewPolygonFeedbackClass();

            polygon.SpatialReference = spr;
            IPointCollection pntcols = polygon as IPointCollection;
            for (int i = 0; i < pnts.Count; i++)
            {
                pntcols.AddPoint(pnts[i]);
            }
            if (!polygon.IsClosed)
                polygon.Close();
            //polygon.Close();
            return polygon;
        }