{

       IFeatureCursor pFeatureCursor = _featureClass.Insert(true);
                IFeatureBuffer pFeatureBuffer = _featureClass.CreateFeatureBuffer();

                object missing = Type.Missing;
                IPointCollection points = new RingClass();
                IPoint pt1 = new PointClass();
                pt1.X = 0;
                pt1.Y = 0;
                points.AddPoint(pt1, ref missing, ref missing);
                IPoint pt2 = new PointClass();
                pt2.X = 0;
                pt2.Y = 1;
                points.AddPoint(pt2, ref missing, ref missing);
                IPoint pt3 = new PointClass();
                pt3.X = 1;
                pt3.Y = 1;
                points.AddPoint(pt3, ref missing, ref missing);
                IPoint pt4 = new PointClass();
                pt4.X = 1;
                pt4.Y = 0;
                points.AddPoint(pt4, ref missing, ref missing);
                IPoint pt5 = new PointClass();
                pt5.X = 0;
                pt5.Y = 0;
                points.AddPoint(pt5, ref missing, ref missing);
                MultipointClass mp = points as MultipointClass;

                IRing ring = points as IRing;
                ISegmentCollection SegCol = ring as ISegmentCollection;
                IPolygon pPolygon = new PolygonClass();

                ISegmentCollection newSegCol = pPolygon as ISegmentCollection;
                newSegCol.AddSegmentCollection(SegCol);

                pFeatureBuffer.Shape = pPolygon;

 
                pFeatureCursor.InsertFeature(pFeatureBuffer);
                pFeatureCursor.Flush();

}

 

相关文章:

  • 2021-08-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-07
  • 2021-05-23
  • 2021-09-18
  • 2022-12-23
猜你喜欢
  • 2021-07-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-06
  • 2022-12-23
相关资源
相似解决方案