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;
        }
    }
  • 相关阅读:
    Elasticsearch 快速入门
    Linux 非互联网环境安装依赖包
    linux 安装mysql(rpm文件安装)
    Nginx安装与配置文件nginx.conf详解
    Linux 知识
    MySQL Windows安装连接
    post请求body格式
    MySQL 数据库备份
    SOAP与restful webservice
    大数据架构工具hadoop
  • 原文地址:https://www.cnblogs.com/jiguixin/p/2575057.html
Copyright © 2011-2022 走看看