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

资源简介

ArcEngine基于C#的开发,这次的是统计图表,包括柱状图和饼状图,统计的是某个图层中某个字段的唯一值对比,代码比较简单,参考使用

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Display;

namespace Statistics
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        #region 打开文件
        /// 
        /// 打开文件
        /// 

        /// 
        /// 
        private void OpenMenu_Click(object sender EventArgs e)
        {
            try
            {
                OpenFileDialog pOpenFileDialog = new OpenFileDialog();
                pOpenFileDialog.CheckFileExists = true;
                pOpenFileDialog.title = “打开地图文档“;
                pOpenFileDialog.Filter = “ArcMap文档(*.mxd)|*.mxd;|ArcMap模板(*.mxt)|*.mxt|发布地图文件(*.pmf)|*.pmf|所有地图格式(*.mxd;*.mxt;*.pmf)|*.mxd;*.mxt;*.pmf“;
                pOpenFileDialog.Multiselect = false;
                //存储打开文件的路径
                pOpenFileDialog.RestoreDirectory = true;
                if (pOpenFileDialog.ShowDialog() == DialogResult.OK)
                {
                    string pFileName = pOpenFileDialog.FileName;
                    if (pFileName == ““)
                    { return; }
                    //检查地图文档有效性
                    if (axMapControl1.CheckMxFile(pFileName))
                    {
                        //新建Map
                        IMap pMap = new MapClass();
                        pMap.Name = “Map“;
                        axMapControl1.DocumentFilename = string.Empty;
                        axMapControl1.Map = pMap;
                        axMapControl1.LoadMxFile(pFileName);
                    }
                    else
                    {
                        MessageBox.Show(pFileName + “是无效的地图文档!“ “信息提示“);
                        return;
                    }
                }            
            }
            catch(Exception ex)
            {
                MessageBox.Show(“打开地图文档失败!“ + ex.Message);
            }
        }

        #endregion


        #region 变量
        private IFeaturelayer pCurrentLyr = null;
        private IActiveView pActiveView = null;
        private Listayer> pLstlayers = null;
        #endregion

        private void HistogramChartMenu_Click(object sender EventArgs e)
        {
            HistogramChart hc = new HistogramChart();
            hc.CurrentMap = axMapControl1.Map;
            hc.Show();

            
                
        }

        private void comboBox1_SelectedIndexChanged(object sender EventArgs e)
        {
            
        }

        private void comboBox1_Click(object sender EventArgs e)
        {
            
        }


    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-09-14 11:06  ArcEngine统计图表\
     目录           0  2017-09-14 11:06  ArcEngine统计图表\Statistics\
     文件        8472  2017-09-07 08:58  ArcEngine统计图表\Statistics\Form1.Designer.cs
     文件        3125  2017-09-07 09:11  ArcEngine统计图表\Statistics\Form1.cs
     文件       12175  2017-09-07 08:58  ArcEngine统计图表\Statistics\Form1.resx
     文件        9587  2017-09-08 16:38  ArcEngine统计图表\Statistics\HistogramChart.Designer.cs
     文件       14614  2017-09-08 16:38  ArcEngine统计图表\Statistics\HistogramChart.cs
     文件        5817  2017-09-08 16:38  ArcEngine统计图表\Statistics\HistogramChart.resx
     文件        4635  2017-09-08 10:27  ArcEngine统计图表\Statistics\MapManager.cs
     文件         578  2017-09-06 09:00  ArcEngine统计图表\Statistics\Program.cs
     目录           0  2017-09-14 11:06  ArcEngine统计图表\Statistics\Properties\
     文件        1352  2017-09-06 08:47  ArcEngine统计图表\Statistics\Properties\AssemblyInfo.cs
     文件        2872  2017-09-06 08:47  ArcEngine统计图表\Statistics\Properties\Resources.Designer.cs
     文件        5612  2017-09-06 08:47  ArcEngine统计图表\Statistics\Properties\Resources.resx
     文件        1097  2017-09-06 08:47  ArcEngine统计图表\Statistics\Properties\Settings.Designer.cs
     文件         249  2017-09-06 08:47  ArcEngine统计图表\Statistics\Properties\Settings.settings
     文件        6453  2017-09-07 11:23  ArcEngine统计图表\Statistics\Statistics.csproj
     目录           0  2017-09-14 11:06  ArcEngine统计图表\Statistics\bin\
     目录           0  2017-09-14 11:06  ArcEngine统计图表\Statistics\bin\Debug\
     文件       26112  2017-09-08 16:30  ArcEngine统计图表\Statistics\bin\Debug\Statistics.exe
     文件       46592  2017-09-08 16:30  ArcEngine统计图表\Statistics\bin\Debug\Statistics.pdb
     文件       11600  2017-09-14 11:06  ArcEngine统计图表\Statistics\bin\Debug\Statistics.vshost.exe
     文件         490  2010-03-17 22:39  ArcEngine统计图表\Statistics\bin\Debug\Statistics.vshost.exe.manifest
     目录           0  2017-09-14 11:06  ArcEngine统计图表\Statistics\obj\
     目录           0  2017-09-14 11:06  ArcEngine统计图表\Statistics\obj\x86\
     目录           0  2017-09-14 11:06  ArcEngine统计图表\Statistics\obj\x86\Debug\
     文件      128121  2017-09-08 08:52  ArcEngine统计图表\Statistics\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        7470  2017-09-08 16:30  ArcEngine统计图表\Statistics\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件        4277  2017-09-07 11:23  ArcEngine统计图表\Statistics\obj\x86\Debug\Statistics.Form1.resources
     文件         180  2017-09-08 16:30  ArcEngine统计图表\Statistics\obj\x86\Debug\Statistics.HistogramChart.resources
     文件         180  2017-09-07 11:23  ArcEngine统计图表\Statistics\obj\x86\Debug\Statistics.Properties.Resources.resources
............此处省略8个文件信息

评论

共有 条评论