zoukankan      html  css  js  c++  java
  • arcgis 线转面

    /// <summary>
    /// 由线转为面
    /// </summary>
    /// <param name="pPolyline"></param>
    /// <returns></returns>
    private IPolygon PolyLineToPolygon(IPolyline pPolyline)
    {
        object obj = Type.Missing;
    
        IClone pClonepPolyline = pPolyline as IClone;
    
        try
        {
            // 闭合线
            if (pPolyline.IsClosed)
            {
                ISegmentCollection pPolylineSegment = pClonepPolyline.Clone()
                    as ISegmentCollection;
                ISegmentCollection pPolygonSegment = new PolygonClass();
    
                for (int i = 0; i < pPolylineSegment.SegmentCount; i++)
                {
                    pPolygonSegment.AddSegment(
                        pPolylineSegment.get_Segment(i), ref obj, ref obj);
                }
    
                return pPolygonSegment as IPolygon;
            }
            // 非闭合线
            else
            {
                IPointCollection pPolylinePoint = pClonepPolyline.Clone()
                    as IPointCollection;
                IPointCollection pPolygonPoint = new PolygonClass();
    
                for (int i = 0; i < pPolylinePoint.PointCount; i++)
                {
                    pPolygonPoint.AddPoint(
                        pPolylinePoint.get_Point(i), ref obj, ref obj);
                }
    
                IPolygon pPolygon = pPolygonPoint as IPolygon;
                //pPolygon.Close();
    
                return pPolygonPoint as IPolygon;
            }
        }
        catch (Exception exc)
        {
            Console.WriteLine(exc.Message);
            return null;
        }
    }
  • 相关阅读:
    5.scala中的对象
    4.scala中的类
    第八章 前端框架
    第六章 用户管理
    第五章 权限验证
    第四章 功能初始化
    第三章 项目结构
    第二章 基于二进制进行权限管理的理论知识
    第一章 权限管理DEMO简介
    NopCommerce源代码分析之用户验证和权限管理
  • 原文地址:https://www.cnblogs.com/jiguixin/p/2575057.html
Copyright © 2011-2022 走看看