資源簡介
ArcEngine二次開發 地圖中的查詢統計

代碼片段和文件信息
using?ESRI.ArcGIS.Carto;
using?ESRI.ArcGIS.Geometry;
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Threading.Tasks;
using?System.Windows.Forms;
namespace?查詢統計
{
????public?partial?class?FormMain?:?Form
????{
????????//定義ISelectionEnvironment接口的對象來設置選擇環境
????????private?ISelectionEnvironment?selectionEnvironment;
????????public?FormMain()
????????{
????????????InitializeComponent();
????????????//窗體初始化時新建ISelectionEnvironment接口的對象,對象具有默認的選項設置值
????????????selectionEnvironment?=?new?SelectionEnvironmentClass();
????????}
????????private?void?屬性查詢ToolStripMenuItem_Click(object?sender?EventArgs?e)
????????{
????????????//新創建屬性查詢窗體
????????????FormQueryByAttribute?formQueryByAttribute?=?new?FormQueryByAttribute();
????????????//將當前主窗體中MapControl控件中的Map對象賦值給FormQueryByAttribute窗體的CurrentMap屬性
????????????formQueryByAttribute.CurrentMap?=?axMapControl.Map;
????????????//顯示屬性查詢窗體
????????????formQueryByAttribute.Show();
????????}
????????private?void?打開ToolStripMenuItem_Click(object?sender?EventArgs?e)
????????{
????????????//使用對話框選擇要打開的mxd文檔
????????????using?(OpenFileDialog?openFileDialog?=?new?OpenFileDialog())
????????????{
????????????????openFileDialog.Filter?=?“ArcMap?Documents?(*.mxd)|*.mxd“;
????????????????if?(openFileDialog.ShowDialog()?==?System.Windows.Forms.DialogResult.OK)
????????????????{
????????????????????string?filePath?=?openFileDialog.FileName;
????????????????????axMapControl.LoadMxFile(filePath);
????????????????}
????????????}
????????}
????????private?void?空間查詢ToolStripMenuItem_Click(object?sender?EventArgs?e)
????????{
????????????//新創建空間查詢窗體
????????????FormQueryBySpatial?formQueryBySpatial?=?new?FormQueryBySpatial();
????????????//將當前主窗體中MapControl控件中的Map對象賦值給FormSelection窗體的CurrentMap屬性
????????????formQueryBySpatial.CurrentMap?=?axMapControl.Map;
????????????//顯示空間查詢窗體
????????????formQueryBySpatial.Show();
????????}
????????private?void?圖形查詢ToolStripMenuItem_Click(object?sender?EventArgs?e)
????????{
????????????try
????????????{
????????????????//首先清空地圖選擇集,以進行后續的選擇操作
????????????????axMapControl.Map.FeatureSelection.Clear();
????????????????//使用IGraphicsContainer接口獲取地圖中的各個圖形(Graphics)
????????????????IGraphicsContainer?graphicsContainer?=?axMapControl.Map?as?IGraphicsContainer;
????????????????//重置訪問圖形的游標,使IGraphicsContainer接口的Next()方法定位于地圖中的第一個圖形
????????????????graphicsContainer.Reset();
????????????????//使用IElement接口操作所獲取第一個圖形
????????????????IElement?element?=?graphicsContainer.Next();
????????????????//獲取圖形的幾何信息
????????????????IGeometry?geometry?=?element.Geometry;
????????????????//使用第一個圖形的幾何形狀來選擇地圖中的要素。
????????????????axMapControl.Map.SelectByShape(geometry?null?false);
????????????????//進行部分刷新以顯示最新的選擇集
????????????????axMapControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection?null
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????926??2017-07-13?15:24??02查詢統計\02查詢統計.sln
????..A..H.????147456??2017-07-24?19:33??02查詢統計\02查詢統計.v11.suo
?????文件????????187??2017-07-13?15:24??02查詢統計\查詢統計\App.config
?????文件??????61440??2013-05-28?16:58??02查詢統計\查詢統計\bin\Debug\ESRI.ArcGIS.ADF.Connection.dll
?????文件??????32768??2013-05-28?16:58??02查詢統計\查詢統計\bin\Debug\ESRI.ArcGIS.ADF.Connection.Local.dll
?????文件??????26300??2009-07-14?09:55??02查詢統計\查詢統計\bin\Debug\ESRI.ArcGIS.ADF.Connection.Local.xm
?????文件??????74725??2009-05-28?15:09??02查詢統計\查詢統計\bin\Debug\ESRI.ArcGIS.ADF.Connection.xm
?????文件?????196608??2013-05-28?16:58??02查詢統計\查詢統計\bin\Debug\ESRI.ArcGIS.ADF.dll
?????文件?????679882??2009-05-28?15:08??02查詢統計\查詢統計\bin\Debug\ESRI.ArcGIS.ADF.xm
?????文件??????23040??2013-05-28?16:02??02查詢統計\查詢統計\bin\Debug\ESRI.ArcGIS.Desktop.AddIns.dll
?????文件???????5632??2013-05-28?13:36??02查詢統計\查詢統計\bin\Debug\ESRI.ArcGIS.Desktop.AddIns.v4.0.dll
?????文件??????59904??2017-07-24?19:24??02查詢統計\查詢統計\bin\Debug\查詢統計.exe
?????文件????????187??2017-07-13?15:24??02查詢統計\查詢統計\bin\Debug\查詢統計.exe.config
?????文件??????87552??2017-07-24?19:24??02查詢統計\查詢統計\bin\Debug\查詢統計.pdb
?????文件??????22984??2017-07-24?19:24??02查詢統計\查詢統計\bin\Debug\查詢統計.vshost.exe
?????文件????????187??2017-07-13?15:24??02查詢統計\查詢統計\bin\Debug\查詢統計.vshost.exe.config
?????文件????????490??2010-03-17?22:39??02查詢統計\查詢統計\bin\Debug\查詢統計.vshost.exe.manifest
?????文件???????5505??2017-07-24?19:24??02查詢統計\查詢統計\FormMain.cs
?????文件??????11513??2017-07-24?19:24??02查詢統計\查詢統計\FormMain.Designer.cs
?????文件??????11473??2017-07-24?19:24??02查詢統計\查詢統計\FormMain.resx
?????文件???????4209??2017-07-13?18:39??02查詢統計\查詢統計\FormOptions.cs
?????文件???????8883??2017-07-13?18:39??02查詢統計\查詢統計\FormOptions.Designer.cs
?????文件???????6016??2017-07-13?18:39??02查詢統計\查詢統計\FormOptions.resx
?????文件??????16218??2017-07-13?16:45??02查詢統計\查詢統計\FormQueryByAttribute.cs
?????文件??????20694??2017-07-13?16:44??02查詢統計\查詢統計\FormQueryByAttribute.Designer.cs
?????文件???????5817??2017-07-13?16:45??02查詢統計\查詢統計\FormQueryByAttribute.resx
?????文件??????10080??2017-07-13?17:26??02查詢統計\查詢統計\FormQueryBySpatial.cs
?????文件??????12843??2017-07-13?17:26??02查詢統計\查詢統計\FormQueryBySpatial.Designer.cs
?????文件???????5817??2017-07-13?17:26??02查詢統計\查詢統計\FormQueryBySpatial.resx
?????文件???????8487??2017-07-13?18:01??02查詢統計\查詢統計\FormSelection.cs
............此處省略45個文件信息
評論
共有 條評論