AE实习报告.docx
- 文档编号:9354807
- 上传时间:2023-02-04
- 格式:DOCX
- 页数:28
- 大小:23.42KB
AE实习报告.docx
《AE实习报告.docx》由会员分享,可在线阅读,更多相关《AE实习报告.docx(28页珍藏版)》请在冰豆网上搜索。
AE实习报告
《GIS程序设计与开发》实验报告
实验一、基于AE的二次开发环境的搭建
一、实验目的和要求:
1.实验目的:
掌握基于AE二次开发的可视化开发环境的搭建。
2.主要内容:
安装AE及VS2010等软件及支持软件。
二、实验内容:
1、软件的准备
(1)开发环境所需要的软件:
ArcGIS10.2
(2)所需要的支持软件:
AE、VS2010
2、安装软件ArcGIS10.2、AE
(1)过程:
步骤1:
安装LicenseManager
1.1首先要下载Arcgis10.2软件,很大大约有4个多G。
下载后可以用虚拟光驱,DAEMONToolsLite即可。
1.2首先,根据自己的操作系统安装相应的LicenseManager,这里以Windows为例,双击Arcgis10.2打开安装界面,选择安装。
1.3开始安装LicenseManager,一步一步往下走即可。
1.4LicenseManager安装完成后,点击“stop”关闭LicenseManager运行。
然后点击“OK”即可。
1.5复制破解文件夹里边的破解文件“Service.txt”和"ArcGIS.exe"替换License10.2目录bin下的相同文件。
然后打开service.txt,将红线标记的字母替换为你自己计算机的名字,保存之后关闭。
步骤2:
开始安装ArcGISDeskTop
2.1在安装界面选择ArcGISforDeskTop后面的“setup”开始安装。
2.2安装时你电脑必须已经安装了“.NETFramwork3.5”,如果没有安装请按照提示直接安装即可。
加入你的电脑已经安装了Framwork3.5。
下面就是一步一步往下走即可。
注意选择ArcGISEngineSDKforMicrosoft.netFramework。
2.3选择完全安装,点击下一步,下面需要比较长时间,注意等待。
2.4ArcGISforDeskTop10.2安装完成。
下面是重点,开始破解。
2.5在ArcGIS管理器向导,选择Advanced(ArcInfo)浮动版。
许可管理器那里这里可以先不做修改。
然后点击“确定”。
步骤3:
ArcGIS10.2破解
3.1在开始处,打开在第一步安装的“LicenseManager”界面,点击启动,然后点击确定。
3.2在刚才的ArcGIS管理器向导下面许可管理器那里输入:
localhost,点击确定即可。
3.3破解完成。
可以在ArcGIS管理器里面看到破解成功的情况。
步骤4:
ArcGIS10.2汉化
4.1找到\汉化包\DesktopChinese_CN.msi,直接双击安装。
4.2安装完成后,打开“ArcGISAdministator”中点击“高级”选项,自由切换语言。
到此ArcGIS10.2就安装完毕了。
(2)结果:
软件可用,并成功安装AE。
3、安装软件VS2010
(1)过程:
1.首先,打开浏览器,搜索“VS2010”,之后找到相应的资源之后,开始下载。
2.下载之后,双击exe进行安装(通常下载的安装包是压缩包,先进行解压缩,之后双击解压缩文件中的exe进行安装)。
3.之后,进入到安装选择页面,点击“安装MicrosoftVisualStudio2010”。
4.然后进入到安装检查页面,选择是否发送我的安装体验之后,点击“下一步”。
5.之后,选择“我已阅读并接受许可条款”,之后点击“下一步”。
6.之后,选择需要安装的功能(有完全和自定义两种模式),然后再选择安装的文件路径。
点击“下一步”
7.之后进入到安装组件页面,这个过程不用任何操作,等待大致20分钟左右,具体根据机器的配置。
最后,即可看到安装完成的页面。
(2)结果:
打开VS2010软件,工具箱中有ArcGIS相关工具。
4、安装出现错误及排除
(1)、若之前安装过ArcGIS软件,可能会由于卸载不干净导致安装失败。
(2)、在安装ArcGISforDeskTop时要注意选择ArcGISEngineSDKforMicrosoft.netFramework。
(3)、由于软件是破解版,可能会受到电脑配置、系统已安装软件的影响。
三、实验总结:
这是地理信息系统开发这门课程的第一次上机实习,总的来说,这次实习的任并不困难,首先要掌握基于AE二次开发的可视化开发环境的搭建,并且安装AE及VS2010等软件及支持软件。
这次实习只是让我们初步掌握软件的安装方法与熟悉软件的相应功能,我们也尝试了一些我们专业常用控件的添加方法。
实验二基于AE控件的程序框架设计与使用
一、实验目的和要求:
1.实验目的:
地图显示与浏览。
2.主要内容:
基于AE开发的简单过程,控件的熟悉,类库与接口的理解,完成地理信息应用系统框架的搭建。
二、实验内容:
1、程序设计
(1)代码编写:
//加载地图文档
privatevoidloadMapDocument()
{
System.Windows.Forms.OpenFileDialogopenFileDialog;
openFileDialog=newOpenFileDialog();
openFileDialog.Title="打开地图文档";
openFileDialog.Filter="mapdocuments(*.mxd)|*.mxd";
if(openFileDialog.ShowDialog()==DialogResult.OK)
{
stringfilePath=openFileDialog.FileName;
if(axMapControl1.CheckMxFile(filePath))
{
axMapControl1.MousePointer=esriControlsMousePointer.esriPointerHourglass;
axMapControl1.LoadMxFile(filePath,0,Type.Missing);
axMapControl1.MousePointer=esriControlsMousePointer.esriPointerDefault;
loadEagleEyeDocument(filePath);
axMapControl1.Extent=axMapControl1.FullExtent;
}
else
{
MessageBox.Show(filePath+"不是有效的地图文档");
}
}
}
//加载地图文档中的特定地图
privatevoidloadMapDocument2()
{
System.Windows.Forms.OpenFileDialogopenFileDialog;
openFileDialog=newOpenFileDialog();
openFileDialog.Title="打开地图文档";
openFileDialog.Filter="mapdocuments(*.mxd)|*.mxd";
if(openFileDialog.ShowDialog()==DialogResult.OK)
{
stringfilePath=openFileDialog.FileName;
if(axMapControl1.CheckMxFile(filePath))
{
IArrayarrayMap=axMapControl1.ReadMxMaps(filePath,Type.Missing);
inti;
IMapmap;
for(i=0;i { map=arrayMap.get_Element(i)asIMap; if(map.Name=="Layers") { axMapControl1.MousePointer=esriControlsMousePointer.esriPointerHourglass; axMapControl1.LoadMxFile(filePath,0,Type.Missing); axMapControl1.MousePointer=esriControlsMousePointer.esriPointerDefault; loadEagleEyeDocument(filePath); axMapControl1.Extent=axMapControl1.FullExtent; break; } } } else { MessageBox.Show(filePath+"不是有效的地图文档"); } } } //保存地图文档 privatevoidsaveDocument() { if(mapDocument==null) { MessageBox.Show("地图文档对象为空,请先加载地图文档"); } else { if(mapDocument.get_IsReadOnly(mapDocument.DocumentFilename)==true) { MessageBox.Show("地图文档是只读的无法保存"); } else { stringfileSavePath=@"E: \World\newworld1.mxd"; try { mapDocument.Save(mapDocument.UsesRelativePaths,true); MessageBox.Show("保存地图文档成功"); } catch(Exceptione) { MessageBox.Show("保存地图文档失败! ! ! "+e.ToString()); } } } } privatevoidaddShapeFile() { System.Windows.Forms.OpenFileDialogopenFileDialog; openFileDialog=newOpenFileDialog(); openFileDialog.Title="打开图层文件"; openFileDialog.Filter="mapdocuments(*.shp)|*.shp"; if(openFileDialog.ShowDialog()==DialogResult.OK) { FileInfofileInfo=newFileInfo(openFileDialog.FileName); Stringpath=fileInfo.Directory.ToString(); StringfileName=fileInfo.Name.Substring(0,fileInfo.Name.IndexOf(".")); try { axMapControl1.AddShapeFile(path,fileName); } catch(Exceptione) { MessageBox.Show("添加图层失败! ! ! "+e.ToString()); } } } //删除图层 privatevoiddeleteLayer() { try { //删除地图中所有的图层 for(inti=axMapControl1.LayerCount-1;i>=0;i--) { axMapControl1.DeleteLayer(i); } } catch(Exceptione) { MessageBox.Show("删除图层失败! ! ! "+e.ToString()); } } //移动图层 privatevoidmoveLayer() { if(axMapControl1.LayerCount>0) { try { //将最下层图层文件移动到最上层 axMapControl1.MoveLayerTo(axMapControl1.LayerCount-1,0); } catch(Exceptione) { MessageBox.Show("移动图层失败! ! ! "+e.ToString()); } } } (2)代码理解: 图层加载功能将用到Mapcontrol控件提供的loadmixfile方法,该方法通过指定的*.max文档路径直接获取。 加载mxd文档时可以通过Mapcontrol控件的checkmxfile方法进行验证mxd文档路径的有效性。 Mapdocument对象提供了地图文档对象的保存和另存,方法分别是save、saveas,在进行文档保存前需要先对地图文档是否可读进行判断,Mapdocument对象提供了get-isreadonly方法 图层操作是gis中常用的功能,涉及图层的添加、删除、移动等。 使用Mapcontrol自带的的addlayerfromfile方法,提供lyr图层文件的路径,即可加载地图。 Mapcontrol自带的Deletelayer方法用于删除图层 2、代码调试及运行 (1)错误类型及排除: Mapdocument对象提供了地图文档对象的保存方法save时代码没有实例化,发生错误。 改正方法: 在代码开头添加 IMapdocumentmapdocument; Mapdocument=newesri.arcgis.carto.mapdocumentclass(); (2)疑难及理解: Axmapcontrol.loadmxfile(filepath,0,type.missing) 三个参数分别是路径、名称、密码 3、实验总结: 本次实习的主要内容为基于AE开发的简单过程,控件的熟悉,类库与接口的理解,完成地理信息应用系统框架的搭建。 通过代码的编写,完成地图显示与操作的功能。 通过AE进行二次开发,根据软件要实现的功能,进行相应控件的添加,并且利用相应的接口进行实现。 通过这次实习使我初步的了解了基于AE的二次开发,从中也深深地感受到了基于AE的二次开发的便捷与强大。 实验三AE开发专题几何对象与空间坐标系 1、实验目的和要求: 1.实验目的: 利用AE进行各类几何对象的添加、插入与删除等编辑。 2.主要内容: 3.点、多点、各类曲线、面对象的编辑实现。 2、实验内容: 1、程序设计 (1)代码编写: //添加实体对象 privatevoidtoolStripMenuItem1_Click(objectsender,EventArgse) { IGeometryCollectiongeometryCollection=newMultipointClass(); IMultipointmultipoint; objectmissing=Type.Missing; IPointpoint; for(inti=0;i<10;i++) { point=newPointClass(); point.PutCoords(i*2,i*2); geometryCollection.AddGeometry(pointasIGeometry,refmissing,refmissing); } multipoint=geometryCollectionasIMultipoint; addFeature("multipoint",multipointasIGeometry); this.axMapControl1.Extent=multipoint.Envelope; this.axMapControl1.Refresh(); } //添加实体对象集 privatevoidaddGeometryCollectionToolStripMenuItem_Click(objectsender,EventArgse) { IGeometryCollectiongeometryCollection1=newMultipointClass(); IGeometryCollectiongeometryCollection2=newMultipointClass(); IMultipointmultipoint; objectmissing=Type.Missing; IPointpoint; for(inti=0;i<10;i++) { point=newPointClass(); point.PutCoords(i*2,i*2); geometryCollection1.AddGeometry(pointasIGeometry,refmissing,refmissing); } geometryCollection2.AddGeometryCollection(geometryCollection1); multipoint=geometryCollection2asIMultipoint; addFeature("multipoint",multipointasIGeometry); this.axMapControl1.Extent=multipoint.Envelope; this.axMapControl1.Refresh(); } //插入实体对象集 privatevoidinsertGeometriesCollectionToolStripMenuItem_Click(objectsender,EventArgse) { IGeometryCollectiongeometryCollection1=newMultipointClass(); IGeometryCollectiongeometryCollection2=newMultipointClass(); IGeometryCollectiongeometryCollection3=newMultipointClass(); IGeometryCollectiongeometryCollection4=newMultipointClass(); IMultipointmultipoint; objectmissing=Type.Missing; IPointpoint; //? ? 3? ? ? ? ? ? for(inti=0;i<10;i++) { point=newPointClass(); point.PutCoords(i*2,i); geometryCollection1.AddGeometry(pointasIGeometry,refmissing,refmissing); } for(inti=0;i<10;i++) { point=newPointClass(); point.PutCoords(i,i); geometryCollection2.AddGeometry(pointasIGeometry,refmissing,refmissing); } for(inti=0;i<10;i++) { point=newPointClass(); point.PutCoords(i,i*2); geometryCollection3.AddGeometry(pointasIGeometry,refmissing,refmissing); } geometryCollection1.InsertGeometryCollection(1,geometryCollection2); geometryCollection1.InsertGeometryCollection(1,geometryCollection3); multipoint=geometryCollection1asIMultipoint; addFeature("multipoint",multipointasIGeometry); this.axMapControl1.Extent=multipoint.Envelope; this.axMapControl1.Refresh(); } //查询Segment privatevoidquerySegmentsToolStripMenuItem_Click(objectsender,EventArgse) { ISegment[]segmentArray=newISegment[10]; for(inti=0;i<10;i++) { ILineline=newLineClass(); IPointfromPoint=newPointClass(); fromPoint.PutCoords(i*10,i*10); IPointtoPoint=newPointClass(); toPoint.PutCoords(i*15,i*15); line.PutCoords(fromPoint,toPoint); segmentArray[i]=lineasISegment; } ISegmentCollectionsegmentCollection=newPolylineClass(); IGeometryBridgegeometryBridge=newGeometryEnvironmentClass(); geometryBridge.AddSegments(segmentCollection,refsegmentArray); intindex=0; ISegment[]outputSegmentArray=newISegment[segmentCollection.SegmentCount-index]; for(inti=0;i { outputSegmentArray[i]=newLineClass(); } //? ? Segment geometryBridge.QuerySegments(segmen
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- AE 实习 报告