来自:http://www.cnblogs.com/lee24789229/p/5481978.html

通过传入坐标点,返回几何图形,此代码部分可以生成环形面。 

方法一

C#Arcengine通过坐标点生成面(环形)
        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;

        }
C#Arcengine通过坐标点生成面(环形)

方法二:

C#Arcengine通过坐标点生成面(环形)
        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;
        }
C#Arcengine通过坐标点生成面(环形)

 

本博客有部分内容来自网络,如有问题请联系QQ24789229,并注明来自博客园。

来自:http://www.cnblogs.com/lee24789229/p/5481978.html

通过传入坐标点,返回几何图形,此代码部分可以生成环形面。 

方法一

C#Arcengine通过坐标点生成面(环形)
        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;

        }
C#Arcengine通过坐标点生成面(环形)

方法二:

C#Arcengine通过坐标点生成面(环形)
        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;
        }
C#Arcengine通过坐标点生成面(环形)

 

相关文章:

  • 2021-10-22
  • 2021-11-18
  • 2021-06-25
  • 2021-10-23
  • 2021-12-31
  • 2022-12-23
  • 2021-04-11
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-26
  • 2022-12-23
  • 2021-07-11
  • 2022-12-23
相关资源
相似解决方案