private IGeometry getGeometry1(IPointCollection Points) {//点转面 //IPointCollection iPointCollection = new PolygonClass(); object pMissing = Type.Missing; //iPointCollection.AddPointCollection(Points); IGeometryCollection pGeoColl = Points as IGeometryCollection; ISegmentCollection pRing = new RingClass(); pRing.AddSegmentCollection(pGeoColl as ISegmentCollection); object miss = Type.Missing; IGeometryCollection pPolygon = new PolygonClass(); pPolygon.AddGeometry(pRing as IGeometry, ref miss, ref miss); ITopologicalOperator topologicalOperator = pPolygon as ITopologicalOperator; topologicalOperator.Simplify(); return pPolygon as IGeometry; }
private IGeometry getGeometry(IPointCollection Points) { //环 IPointCollection iPointCollection = new PolygonClass(); Ring ring = new RingClass(); object missing = Type.Missing; ring.AddPointCollection(Points); IGeometryCollection pointPolygon = new PolygonClass(); pointPolygon.AddGeometry(ring as IGeometry, ref missing, ref missing); IPolygon polyGonGeo = pointPolygon as IPolygon; //polyGonGeo.Close(); polyGonGeo.SimplifyPreserveFromTo(); return polyGonGeo as IGeometry; }