• 大小: 4.03MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-17
  • 语言: 其他
  • 标签: AE开发  

资源简介

实现了矢量数据编辑的基本功能,包括选择要素,删除要素,移动要素,节点编辑,属性编辑等基本编辑功能

资源截图

代码片段和文件信息

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.Controls;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Geodatabase;
using GISEditor.EditTool.BasicClass;
using GISEditor.EditTool.Tool;
using GISEditor.EditTool.Command;
using ESRI.ArcGIS.SystemUI;
using ESRI.ArcGIS.Geometry;

namespace GISEditor
{
    public partial class frmMain : Form
    {

        #region 变量定义        
        private string sMxdPath = Application.StartupPath ;
        private IMap pMap = null;
        private IActiveView pActiveView = null;
        private Listayer> plstlayers = null;
        private IFeaturelayer pCurrentLyr = null;      
        private IEngineEditor pEngineEditor = null;
        private IEngineEditTask pEngineEditTask = null;
        private IEngineEditlayers pEngineEditlayers = null;

        #endregion

        #region 初始化


        public frmMain()
        {
            InitializeComponent();
            Initobject();
        }

        private void Initobject()
        {
            try
            {
                ChangeButtonState(false);
                pEngineEditor = new EngineEditorClass();
                MapManager.EngineEditor = pEngineEditor;
                pEngineEditTask = pEngineEditor as IEngineEditTask;
                pEngineEditlayers = pEngineEditor as IEngineEditlayers;
                sMxdPath = getPath(sMxdPath) + “\\data\\edit.mxd“; ; 
                if (mainMapControl.CheckMxFile(sMxdPath))
                {
                    mainMapControl.LoadMxFile(sMxdPath);
                }
                pMap = mainMapControl.Map;
                pActiveView = pMap as IActiveView;
                plstlayers = MapManager.Getlayers(pMap);
            }
            catch (Exception ex)
            {

            }
        }

        #endregion

        #region 编辑操作

        /// 
        /// 开始编辑
        /// 

        /// 
        /// 
        private void btnStartEdit_Click(object sender EventArgs e)
        {
            try
            {
                if (plstlayers == null || plstlayers.Count == 0)
                {
                    MessageBox.Show(“请加载编辑图层!“ “提示“
                        MessageBoxButtons.OK MessageBoxIcon.Information);
                    return;
                }

                pMap.ClearSelection();
                pActiveView.Refresh();
                InitComboBox(plstlayers);
                ChangeButtonState(true);
                //如果编辑已经开始,则直接退出
                if (pEngineEditor.EditState != esriEngineEditState.esriEngineStateNotEditing)
                    return;
                if (pCurrentLyr == null) return;               
                //获取当前编辑图层工作空间
                IDataset 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-07-24 17:09  空间数据编辑\
     目录           0  2016-07-24 17:09  空间数据编辑\code\
     目录           0  2016-07-24 17:09  空间数据编辑\code\GISEditor\
     文件        6806  2015-01-26 21:30  空间数据编辑\code\GISEditor\GISEditor.csproj
     文件         168  2015-01-23 21:09  空间数据编辑\code\GISEditor\GISEditor.csproj.user
     文件         747  2015-01-26 17:30  空间数据编辑\code\GISEditor\Program.cs
     目录           0  2016-07-24 17:09  空间数据编辑\code\GISEditor\Properties\
     文件        1348  2015-01-23 21:09  空间数据编辑\code\GISEditor\Properties\AssemblyInfo.cs
     文件        3630  2015-01-26 17:21  空间数据编辑\code\GISEditor\Properties\Resources.Designer.cs
     文件        6721  2015-01-23 21:09  空间数据编辑\code\GISEditor\Properties\Resources.resx
     文件        1108  2015-01-26 17:21  空间数据编辑\code\GISEditor\Properties\Settings.Designer.cs
     文件         249  2015-01-23 21:09  空间数据编辑\code\GISEditor\Properties\Settings.settings
     文件         159  2015-01-26 17:21  空间数据编辑\code\GISEditor\app.config
     目录           0  2016-07-24 17:09  空间数据编辑\code\GISEditor\bin\
     目录           0  2016-07-24 17:09  空间数据编辑\code\GISEditor\bin\Debug\
     文件       49152  2015-01-30 10:02  空间数据编辑\code\GISEditor\bin\Debug\GISEditor.EditTool.dll
     文件      259584  2015-01-30 10:02  空间数据编辑\code\GISEditor\bin\Debug\GISEditor.EditTool.pdb
     文件       56832  2015-01-30 10:02  空间数据编辑\code\GISEditor\bin\Debug\GISEditor.exe
     文件         159  2015-01-26 17:21  空间数据编辑\code\GISEditor\bin\Debug\GISEditor.exe.config
     文件       42496  2015-01-30 10:02  空间数据编辑\code\GISEditor\bin\Debug\GISEditor.pdb
     文件       11600  2016-07-24 09:35  空间数据编辑\code\GISEditor\bin\Debug\GISEditor.vshost.exe
     文件         159  2015-01-26 17:21  空间数据编辑\code\GISEditor\bin\Debug\GISEditor.vshost.exe.config
     文件         490  2015-10-30 15:19  空间数据编辑\code\GISEditor\bin\Debug\GISEditor.vshost.exe.manifest
     目录           0  2016-07-24 17:09  空间数据编辑\code\GISEditor\bin\Debug\Image\
     文件         246  2015-01-23 21:09  空间数据编辑\code\GISEditor\bin\Debug\Image\AddData.bmp
     文件        1482  2015-01-23 21:09  空间数据编辑\code\GISEditor\bin\Debug\Image\AddVertex.bmp
     文件         246  2015-01-23 21:09  空间数据编辑\code\GISEditor\bin\Debug\Image\DelVertex.bmp
     文件         246  2015-01-23 21:09  空间数据编辑\code\GISEditor\bin\Debug\Image\Delete.bmp
     文件         246  2015-01-23 21:09  空间数据编辑\code\GISEditor\bin\Debug\Image\Move.bmp
     文件         246  2015-01-23 21:09  空间数据编辑\code\GISEditor\bin\Debug\Image\MoveVertex.bmp
     文件        1318  2015-01-23 21:09  空间数据编辑\code\GISEditor\bin\Debug\Image\Redo.bmp
............此处省略196个文件信息

评论

共有 条评论