ArcGIS Engine将几何图形Geometry转为多段线Polyline

示例代码如下:

        /// <summary>
        /// Geometry转Polyline
        /// </summary>
        /// <param name="pGeometry">传入的几何图形</param>
        /// <returns>转换后的多段线</returns>
        public static ESRI.ArcGIS.Geometry.IPolyline GeometryToPolyline(ESRI.ArcGIS.Geometry.IGeometry pGeometry)
        {
            if (null == pGeometry)
            {
                return null;
            }
            ESRI.ArcGIS.Geometry.IPolyline aTempPolyline = new ESRI.ArcGIS.Geometry.PolylineClass();
            ESRI.ArcGIS.Geometry.IGeometryCollection aTempGeometryCollection = aTempPolyline as ESRI.ArcGIS.Geometry.IGeometryCollection;
            aTempGeometryCollection.AddGeometry(pGeometry);
            return aTempGeometryCollection as ESRI.ArcGIS.Geometry.IPolyline;
        }

猜你喜欢

转载自blog.csdn.net/a_dev/article/details/79553052
今日推荐