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);
}

转载于:https://www.cnblogs.com/fatherZyl/p/3737326.html

你可能感兴趣的:(Polyline转Polygon)