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