• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

gisoracle

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

View Post

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

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

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

方法一

复制代码
        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;

        }
复制代码

方法二:

复制代码
        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;
        }
复制代码

 

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

posted on 2017-10-29 19:53  gisai  阅读(2583)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3