欢迎来到天天文库
浏览记录
ID:44713566
大小:1.55 MB
页数:28页
时间:2019-10-25
《AE邻近分析及渲染代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、实验六:基于最邻近模型的服务区分析题目要求:1)Form1主界面搭建:2)Form2用于邻近分析和唯一值渲染的界面搭建:*要注意的几点:2.1首先将实验数据存放在系统工程文件夹>bin>Debug文件夹中,如图:2.2后面需要添加一个EngineFunction.cs类:结果如下:2.3如果引用命名空间时出现了红波浪线,则需在解决方案资源管理器中添加引用,选择.NET环境下的以ESRI.ArcGIS开头的命名空间的引用,则代码中的红波浪则会消除,如图:3)如果用于Visual2010+ArCGIS10.0所组成的A
2、rcGISEngine中:Program.cs中需添加一句话用于格式转换:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Windows.Forms;namespace六{staticclassProgram{[STAThread]staticvoidMain(){Application.EnableVisualStyles();ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.P
3、roductCode.EngineOrDesktop);Application.SetCompatibleTextRenderingDefault(false);Application.Run(newForm1());}}}4)Form1代码:usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.T
4、ext;usingSystem.Windows.Forms;usingESRI.ArcGIS.Controls;usingESRI.ArcGIS.Carto;usingESRI.ArcGIS.Geodatabase;usingSystem.IO;usingESRI.ArcGIS.Display;usingESRI.ArcGIS.esriSystem;usingESRI.ArcGIS.DataSourcesFile;usingESRI.ArcGIS.Geometry;namespace六{publicpartialc
5、lassForm1:Form{publicForm1(){InitializeComponent();}privatevoidForm1_Load(objectsender,EventArgse){}privatevoid文件tToolStripMenuItem_Click(objectsender,EventArgse){IWorkspaceFactorypWorkspaceFactory=newShapefileWorkspaceFactoryClass();stringShpPath=Application.
6、StartupPath+@"服务区分析数据";IWorkspacepWorkspace=pWorkspaceFactory.OpenFromFile(ShpPath,0);IFeatureWorkspacepFeatureWorkspace=pWorkspaceasIFeatureWorkspace;IFeatureClasspFeat1=pFeatureWorkspace.OpenFeatureClass("cubsoxaddr_prj.shp");IFeatureLayerpFLayerPoint=newFe
7、atureLayerClass();pFLayerPoint.FeatureClass=pFeat1;pFLayerPoint.Name=pFeat1.AliasName;ILayerpLayerPoint=pFLayerPointasILayer;IFeatureClasspFeat2=pFeatureWorkspace.OpenFeatureClass("chitrt_cent.shp");IFeatureLayerpFLayerPeoplePoint=newFeatureLayerClass();pFLaye
8、rPeoplePoint.FeatureClass=pFeat2;pFLayerPeoplePoint.Name=pFeat2.AliasName;ILayerpLayerPeoplePoint=pFLayerPeoplePointasILayer;IFeatureClasspFCLine=pFeatureWorkspace.OpenFeatureClass
此文档下载收益归作者所有