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;
        }
    }
  • 相关阅读:
    浏览器版本 / 设备系统 检测
    控制HTML页面内容不能选中的方法
    js 正则常用函数
    谁动了我的Mac ??
    有关使用 iview 表单验证的问题
    Object.defineProperty()
    AIX 查看CPU个数
    AIX sed
    df和du显示的磁盘空间使用情况不一致的原因及处理
    Informix ESQL/C使用游标的一个example
  • 原文地址:https://www.cnblogs.com/jiguixin/p/2575057.html
Copyright © 2011-2022 走看看