函数:将一根线段Segment转化为Polyline
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; }