• 大小: 601KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-23
  • 语言: C#
  • 标签:

资源简介

该代码包括AE直方图统计功能,分图层统计生成直方图,并可以直方图导出为图片,把图层的属性表导出成EXCEL

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Geodatabase;


namespace GIS01
{
    class Commonhelper
    {
        public static DataTable GetAttribute(ilayer player)
        {
            IFeaturelayer pFeaturelayer = player as IFeaturelayer;
            IFeatureClass pFeatureClass = pFeaturelayer.FeatureClass;
            IFeatureCursor pFeatureCursor = pFeatureClass.Search(null false);
            IFeature pFeature = pFeatureCursor.NextFeature();

            //获得属性表,暂时还没想出什么办法,不知道能不能直接访问文件中的属性表
            DataTable pTable = new DataTable();
            for (int i = 0; i < pFeatureClass.Fields.FieldCount; i++)          //获取所有列
            {
                IField field = pFeatureClass.Fields.get_Field(i);
                DataColumn pColumn = new DataColumn(field.AliasName);
                pTable.Columns.Add(pColumn);
            }
            while (pFeature != null)
            {
                DataRow pRow = pTable.NewRow();
                for (int i = 0; i < pFeatureClass.Fields.FieldCount; i++)        //添加每一列的值
                {
                    if (i != pFeatureClass.FindField(pFeatureClass.ShapeFieldName))
                    {
                        pRow[i] = pFeature.get_Value(i);
                    }
                    else
                    {
                        switch (pFeatureClass.ShapeType)
                        {
                            case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPoint:
                                pRow[i] = “Point“; break;
                            case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolyline:
                                pRow[i] = “Polyline“; break;
                            case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolygon:
                                pRow[i] = “Polygon“; break;
                            default: pRow[i] = pFeatureClass.ShapeType.ToString(); break;
                        }
                    }
                    //pRow[i] = pFeature.get_Value(i);
                }
                pTable.Rows.Add(pRow);
                pFeature = pFeatureCursor.NextFeature();
            }
            return pTable;
        }

    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      30720  2014-09-05 09:26  GIS01\GIS01\bin\Debug\GIS01.exe

     文件      48640  2014-09-05 09:26  GIS01\GIS01\bin\Debug\GIS01.pdb

     文件      11600  2014-08-29 10:02  GIS01\GIS01\bin\Debug\GIS01.vshost.exe

     文件        490  2013-06-18 20:28  GIS01\GIS01\bin\Debug\GIS01.vshost.exe.manifest

     文件       2451  2014-08-28 11:53  GIS01\GIS01\Commonhelper.cs

     文件       6801  2014-08-28 21:21  GIS01\GIS01\Form1.cs

     文件      21289  2014-08-28 12:28  GIS01\GIS01\Form1.Designer.cs

     文件      10539  2014-08-28 12:28  GIS01\GIS01\Form1.resx

     文件       8567  2014-08-28 11:58  GIS01\GIS01\GIS01.csproj

     文件        452  2014-08-28 11:07  GIS01\GIS01\GIS01.csproj.user

     文件        752  2014-08-28 11:07  GIS01\GIS01\LicenseInitializer.cs

     文件      15232  2014-08-28 11:07  GIS01\GIS01\LicenseInitializer.Designer.cs

     文件        863  2014-08-28 11:07  GIS01\GIS01\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       7323  2014-09-05 09:26  GIS01\GIS01\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件       1164  2014-08-29 10:02  GIS01\GIS01\obj\x86\Debug\GIS01.csproj.FileListAbsolute.txt

     文件        975  2014-08-28 12:28  GIS01\GIS01\obj\x86\Debug\GIS01.csproj.GenerateResource.Cache

     文件      30720  2014-09-05 09:26  GIS01\GIS01\obj\x86\Debug\GIS01.exe

     文件       3221  2014-08-28 12:28  GIS01\GIS01\obj\x86\Debug\GIS01.Form1.resources

     文件      48640  2014-09-05 09:26  GIS01\GIS01\obj\x86\Debug\GIS01.pdb

     文件        180  2014-08-28 11:58  GIS01\GIS01\obj\x86\Debug\GIS01.Properties.Resources.resources

     文件       4608  2014-08-28 11:07  GIS01\GIS01\obj\x86\Debug\TempPE\Properties.Resources.Designer.cs.dll

     文件       1046  2014-08-28 11:07  GIS01\GIS01\Program.cs

     文件       1258  2014-08-28 11:07  GIS01\GIS01\Properties\AssemblyInfo.cs

     文件       2850  2014-08-28 11:07  GIS01\GIS01\Properties\Resources.Designer.cs

     文件       5612  2014-08-28 11:07  GIS01\GIS01\Properties\Resources.resx

     文件       1105  2014-08-28 11:07  GIS01\GIS01\Properties\Settings.Designer.cs

     文件        249  2014-08-28 11:07  GIS01\GIS01\Properties\Settings.settings

     文件       3916  2014-09-09 22:17  GIS01\GIS01.sln

    ..A..H.    135680  2014-09-09 22:17  GIS01\GIS01.suo

     文件      24064  2014-09-05 09:26  GIS01\GIS02\bin\Debug\GIS02.exe

............此处省略253个文件信息

评论

共有 条评论

相关资源