Polyline转Polygon

IGeometry geo = feature.ShapeCopy;
IGeometryCollection pPolyline = geo as IGeometryCollection;

ISegmentCollection pRing;
IGeometryCollection pPolygon = new PolygonClass();
object ob = Type.Missing;
for (int i = 0; i < pPolyline.GeometryCount; i++)
{
pRing = new RingClass();
pRing.AddSegmentCollection(pPolyline.get_Geometry(i) as ISegmentCollection);
pPolygon.AddGeometry(pRing as IGeometry, ref ob, ref ob);
}

posted @ 2014-05-19 17:46  寻梦放歌  阅读(554)  评论(0编辑  收藏  举报