现在的位置: 首页 > 综合 > 正文

函数:将一根线段Segment转化为Polyline

2013年07月10日 ⁄ 综合 ⁄ 共 519字 ⁄ 字号 评论关闭

From: <插件式GIS应用框架的设计与实现>

/// <summary>
        /// 将一根线段segment变成Polyline
        /// </summary>
        /// <param name="iSegment"></param>
        /// <returns></returns>
        private IPolyline getPolylineFromSegment(ISegment iSegment)
        {
            IGeometryCollection pGeoCol = new PolylineClass();
            ISegmentCollection pSegCol = new PathClass();
            ILine pLine = new LineClass();
            pLine.FromPoint = iSegment.FromPoint;
            pLine.ToPoint = iSegment.ToPoint;
            object mis = Type.Missing;
            pSegCol.AddSegment((ISegment)pLine, ref mis, ref mis);
            pGeoCol.AddGeometry((IGeometry)pSegCol,ref mis,ref mis);

            return (IPolyline)pGeoCol;
        }

  

抱歉!评论已关闭.