• Polygone对象


       Polylgon对象是由一个或多个Ring对象的有序集合,它可以是由单个Ring 对象构
    成,也可以使用多个Ring组成。Polygon通常用来代表有面积的多边形矢量对象,如行政
    区,建筑物等。

    组成Polygone的是Ring其中Ring可以分为Outer Ring(外环)和Inner  Ring(内环)
    之分。外环和内环都是有方向的,它们的区别是外环的方向是顺时针的,内环的方向是逆时
    针。

    以下代码片段演示如何构建一个Polygon:
       private  object pMissing = Type.Missing;


             public  IGeometry GetPolygonGeometry()
            {
                const double RingVertexCount = 360;
                const double RingDegrees = 360.0;
                const double pOutRingRadius = 100;
                const double pInRingRadius = 40;
     
                IGeometryCollection pGeometryCollection = new PolygonClass();
     
     
     
                    IPointCollection pOuterPointCollection = new RingClass();
                    IPointCollection pInnerPointCollection = new RingClass();
     
                  
                    
     
                    double pRotationAngleInRadians =
                           GetRadians(RingDegrees / RingVertexCount);
     
                    for (int j = 0; j < RingVertexCount; j++)
                    {
                                           pOuterPointCollection.AddPoint(ConstructPoint(pOutRingRadius
    *Math.Cos(j*pRotationAngleInRadians),pOutRingRadius *Math.Sin(j*pRotationAngleInRadians)), 
    ref pMissing, ref pMissing);
     
                        pOuterPointCollection.AddPoint(ConstructPoint (pInRingRadius * Math.Cos(j
    * pRotationAngleInRadians), pInRingRadius * Math.Sin(j * pRotationAngleInRadians)), ref pMissing,
    ref pMissing);
                               
                                      
                    }

     
         ITopologicalOperator pTopologicalOperator =
                pGeometryCollection as ITopologicalOperator;
         pTopologicalOperator.Simplify();
         return pGeometryCollection as IGeometry;

         }
     
        
         private  double GetRadians(double pDecimalDegrees)
         {
             return pDecimalDegrees * (Math.PI / 180);
         }

  • 相关阅读:
    Topic model的变种及其应用[1]
    关于LDA的文章
    优秀的基于VUE移动端UI框架合集
    uwsgi部署django,里的request调用的接口响应慢解决方法
    vue部署到nginx服务下,非根目录,刷新页面404怎么解决?
    vue 项目部署到nginx
    CentOS7.2安装nginx失败
    vue-router总结
    vuerouter
    django1
  • 原文地址:https://www.cnblogs.com/qiushuixizhao/p/3248079.html
Copyright © 2020-2023  润新知