首页 2021年GIS实验报告

2021年GIS实验报告

举报
开通vip

2021年GIS实验报告试验汇报GIS应用软件开发专业:测绘工程班级:10级测绘三班姓名:学号:指导老师:胡亚撰写时间:5月20日星期一目录TOC\o"1-3"\h\z\uHYPERLINK\l"_Toc"一、程序运行演示PAGEREF_Toc\h2HYPERLINK\l"_Toc"二、问题及处理方案PAGEREF_Toc\h6HYPERLINK\l"_Toc"三、源程序代码PAGEREF_Toc\h7HYPERLINK\l"_Toc"四、心得体会PAGEREF_Toc\h14一、程序...

2021年GIS实验报告
试验汇报GIS应用软件开发专业:测绘 工程 路基工程安全技术交底工程项目施工成本控制工程量增项单年度零星工程技术标正投影法基本原理 班级:10级测绘三班姓名:学号:指导老师:胡亚撰写时间:5月20日星期一目录TOC\o"1-3"\h\z\uHYPERLINK\l"_Toc"一、程序运行演示PAGEREF_Toc\h2HYPERLINK\l"_Toc"二、问题及处理 方案 气瓶 现场处置方案 .pdf气瓶 现场处置方案 .doc见习基地管理方案.doc关于群访事件的化解方案建筑工地扬尘治理专项方案下载 PAGEREF_Toc\h6HYPERLINK\l"_Toc"三、源程序代码PAGEREF_Toc\h7HYPERLINK\l"_Toc"四、 心得体会 决胜全面小康心得体会学党史心得下载党史学习心得下载军训心得免费下载党史学习心得下载 PAGEREF_Toc\h14一、程序运行演示新建项目文件,并实现file中基础功效,显示地图基础要素。如图1图1在工具栏加载按钮,按钮功效是对目前视图缩小3倍;在工具栏加载工具,工具功效在地图上标注目前日期。如图2图2按钮实现缩小3倍功效操作,如图3图3点击地图节点,弹出如图4,图5菜单并实现菜单中内容:图4图5点击图层节点,弹出如图6菜单并需要实现菜单中内容图6点击LegendClass,弹出符号选择对话框,该对话框供用户按需要选择符号并进行更改。如图7图7打开图层属性 关于同志近三年现实表现材料材料类招标技术评分表图表与交易pdf视力表打印pdf用图表说话 pdf ,用户选择某条统计,可弹出如图8,9所表示右键菜单,并实现右键菜单中内容图8图9二、问题及处理方案问题1.VS与之间要进行格式转换,根据所导向步骤进行,不然程序将无法正常运行,出现错误问题2.构建好基础框架后,地图文档中要素显示出现问题。此问题要添加licence控件,不然无法显示地图要素。问题3.使用Toolbar和Toc功效时无法进行操作此问题应在属性设置时建立关联功效。问题4.程序Program文件中要添加对应功效键语句,不然将无法实现功效。问题5.引用接口,方法,比如ADF,要添加对应引用,不然程序出现错误。问题6.在实现两个自定义按钮与工具时,碰到问题:先直接引用现有项未实现,发觉缺乏部分东西,后自己直接创建Basetool和Basecommand类;在代码中报错,重新生成处理方案后顺利处理这个问题。问题7.在实现地图和图层节点右键功效时,碰到琐碎问题,在这个过程中直接引用老师所给多个类,不过报错,是因为命名空间未做修改;缺乏引用,需要依据错误提醒添加对应引用三、源程序代码usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.IO;usingSystem.Runtime.InteropServices;usingESRI.ArcGIS.esriSystem;usingESRI.ArcGIS.Carto;usingESRI.ArcGIS.Controls;usingESRI.ArcGIS.ADF;usingESRI.ArcGIS.SystemUI;usingESRI.ArcGIS.Display;namespaceWindowsFormsApplication2{publicpartialclassMainForm:Form{#regionclassprivatemembersprivateIMapControl3m_mapControl=null;privatestringm_mapDocumentName=string.Empty;#endregionIMapDocumentm_MapDocument=newMapDocument();#regionclassconstructorprivateITOCControl2m_tocControl;privateIToolbarMenum_menuMap;privateIToolbarMenum_menuLayer;privateZoomIn3XCMD1test=newZoomIn3XCMD1();publicMainForm(){InitializeComponent();}privatevoidnewDocumentToolStripMenuItem_Click(objectsender,EventArgse){ICommandcommand=newCreateNewDocument();command.OnCreate(m_mapControl.Object);command.OnClick();}privatevoidopenDocumentToolStripMenuItem_Click(objectsender,EventArgse){openFileDialog1.Title="SaveMapDocumentAs";openFileDialog1.Filter="MapDocuments(*.mxd)|*.mxd";openFileDialog1.ShowDialog();stringsFilePath=openFileDialog1.FileName;if(axMapControl1.CheckMxFile(sFilePath)){axMapControl1.MousePointer=esriControlsMousePointer.esriPointerHourglass;axMapControl1.LoadMxFile(sFilePath,0,Type.Missing);axMapControl1.MousePointer=esriControlsMousePointer.esriPointerDefault;}else{MessageBox.Show(sFilePath+"isnotavalidArcMapdocument");return;}}privatevoidMainForm_Load(objectsender,EventArgse){//gettheMapControlm_mapControl=(IMapControl3)axMapControl1.Object;//disabletheSavemenu(sincethereisnodocumentyet)this.menuSaveDoc.Enabled=false;//定义地图右键菜单,图层右键菜单m_tocControl=(ITOCControl2)axTOCControl1.Object;m_mapControl=(IMapControl3)axMapControl1.Object;//添加菜单到地图节点m_menuMap=newToolbarMenu();m_menuMap.AddItem("esriControls.ControlsAdddataCommand",-1,0,false,esriCommandStyles.esriCommandStyleTextOnly);m_menuMap.AddItem(newLayerVisibility(),1,1,false,esriCommandStyles.esriCommandStyleTextOnly);m_menuMap.AddItem(newLayerVisibility(),2,2,false,esriCommandStyles.esriCommandStyleTextOnly);//添加菜单到图层节点m_menuLayer=newToolbarMenu();m_menuLayer.AddItem(newOpenAttributeTableCmd(),-1,0,false,esriCommandStyles.esriCommandStyleIconAndText);//右键添加属性表m_menuLayer.AddItem(newRemoveLayer(),1,1,false,esriCommandStyles.esriCommandStyleTextOnly);m_menuLayer.AddItem(newRemoveLayer(),1,2,true,esriCommandStyles.esriCommandStyleTextOnly);m_menuLayer.AddItem(newScaleThresholds(),2,3,false,esriCommandStyles.esriCommandStyleTextOnly);m_menuLayer.AddItem(newScaleThresholds(),3,4,false,esriCommandStyles.esriCommandStyleTextOnly);m_menuLayer.AddItem(newLayerSelectable(),1,5,true,esriCommandStyles.esriCommandStyleTextOnly);m_menuLayer.AddItem(newLayerSelectable(),2,6,false,esriCommandStyles.esriCommandStyleTextOnly);m_menuLayer.AddItem(newZoomToLayer(),-1,7,true,esriCommandStyles.esriCommandStyleTextOnly);//Setthehookofeachmenum_menuLayer.SetHook(m_mapControl);m_menuMap.SetHook(m_mapControl);axToolbarControl1.AddItem(test,-1,-1,true,0,esriCommandStyles.esriCommandStyleIconAndText);axToolbarControl1.AddItem(newAddDateTool(),-1,-1,false,0,esriCommandStyles.esriCommandStyleIconAndText);}privatevoidsaveDocumentToolStripMenuItem_Click(objectsender,EventArgse){//executeSaveDocumentcommandif(m_mapControl.CheckMxFile(m_mapDocumentName)){//createanewinstanceofaMapDocumentIMapDocumentmapDoc=newMapDocument();mapDoc.Open(m_mapDocumentName,string.Empty);//MakesurethattheMapDocumentisnotreadonlyif(mapDoc.get_IsReadOnly(m_mapDocumentName)){MessageBox.Show("Mapdocumentisreadonly!");mapDoc.Close();return;}//ReplaceitscontentswiththecurrentmapmapDoc.ReplaceContents((IMxdContents)m_mapControl.Map);//savetheMapDocumentinordertopersistitmapDoc.Save(mapDoc.UsesRelativePaths,false);//closetheMapDocumentmapDoc.Close();}}#endregionprivatevoidsaveAsToolStripMenuItem_Click(objectsender,EventArgse){//executeSaveAsDocumentcommandICommandcommand=newControlsSaveAsDocCommand();command.OnCreate(m_mapControl);command.OnClick();}privatevoidexitToolStripMenuItem_Click(objectsender,EventArgse){Application.Exit();}privatevoidaxMapControl1_OnMouseMove(objectsender,IMapControlEvents2_OnMouseMoveEvente){statusBarXY.Text=string.Format("{0},{1}{2}",e.mapX.ToString("#######.##"),e.mapY.ToString("#######.##"),axMapControl1.MapUnits.ToString().Substring(4));}privatevoidaxMapControl1_OnMapReplaced(objectsender,IMapControlEvents2_OnMapReplacedEvente){test.m_activeView=this.axMapControl1.ActiveView;//添加两个工具时添加//getthecurrentdocumentnamefromtheMapControlm_mapDocumentName=m_mapControl.DocumentFilename;//ifthereisnoMapDocument,diabletheSavemenuandclearthestatusbarif(m_mapDocumentName==string.Empty){menuSaveDoc.Enabled=false;statusBarXY.Text=string.Empty;}else{//enabletheSavemanuandwritethedocnametothestatusbarmenuSaveDoc.Enabled=true;statusBarXY.Text=Path.GetFileName(m_mapDocumentName);}}privatevoidaxTOCControl1_OnMouseDown(objectsender,ITOCControlEvents_OnMouseDownEvente){if(e.button==1){//IBasicMapmap=newMap();IMapMap=newMap();IBasicMapmap=(IBasicMap)Map;ILayerlayer=newFeatureLayer();objectother=newobject();objectindex=newobject();esriTOCControlItemitem=newesriTOCControlItem();//DeterminewhatkindofitemhasbeenclickedonaxTOCControl1.HitTest(e.x,e.y,refitem,refmap,reflayer,refother,refindex);//QItoIFeatureLayerandIGeoFeatuerLayerinterfaceif(layer==null)return;IFeatureLayerfeatureLayer=layerasIFeatureLayer;if(featureLayer==null)return;IGeoFeatureLayergeoFeatureLayer=(IGeoFeatureLayer)featureLayer;ILegendClasslegendClass=newLegendClass();ISymbolsymbol=null;if(otherisILegendGroup&&(int)index!=-1){legendClass=((ILegendGroup)other).get_Class((int)index);symbol=legendClass.Symbol;}if(symbol==null)return;symbol=GetSymbolByControl(symbol);//symbol=GetSymbolBySymbolSelector(symbol);if(symbol==null)return;legendClass.Symbol=symbol;this.Activate();//FirecontentschangedeventthattheTOCControllistenstoaxMapControl1.ActiveView.ContentsChanged();//RefreshthedisplayaxMapControl1.Refresh(esriViewDrawPhase.esriViewGeography,null,null);axTOCControl1.Update();}if(e.button==2){esriTOCControlItemitem=esriTOCControlItem.esriTOCControlItemNone;IBasicMapmap=null;ILayerlayer=null;objectother=null;objectindex=null;//Determinewhatkindofitemisselectedm_tocControl.HitTest(e.x,e.y,refitem,refmap,reflayer,refother,refindex);//Ensuretheitemgetsselectedif(item==esriTOCControlItem.esriTOCControlItemMap)m_tocControl.SelectItem(map,null);elsem_tocControl.SelectItem(layer,null);//SetthelayerintotheCustomProperty(thisisusedbythecustomlayercommands)m_mapControl.CustomProperty=layer;//Popupthecorrectcontextmenuif(item==esriTOCControlItem.esriTOCControlItemMap)m_menuMap.PopupMenu(e.x,e.y,m_tocControl.hWnd);if(item==esriTOCControlItem.esriTOCControlItemLayer)m_menuLayer.PopupMenu(e.x,e.y,m_tocControl.hWnd);}}privateISymbolGetSymbolByControl(ISymbolsymbolType){ISymbolsymbol=null;IStyleGalleryItemstyleGalleryItem=null;esriSymbologyStyleClassstyleClass=esriSymbologyStyleClass.esriStyleClassMarkerSymbols;if(symbolTypeisIMarkerSymbol){styleClass=esriSymbologyStyleClass.esriStyleClassMarkerSymbols;}if(symbolTypeisILineSymbol){styleClass=esriSymbologyStyleClass.esriStyleClassLineSymbols;}if(symbolTypeisIFillSymbol){styleClass=esriSymbologyStyleClass.esriStyleClassFillSymbols;}GetSymbolByControlFormsymbolForm=newGetSymbolByControlForm(styleClass);symbolForm.ShowDialog();styleGalleryItem=symbolForm.m_styleGalleryItem;if(styleGalleryItem==null)returnnull;symbol=styleGalleryItem.ItemasISymbol;symbolForm.Dispose();this.Activate();returnsymbol;}}}四、心得体会此次试验过程中,值得肯定是,已对AO开发通常步骤基础掌握:新建项目、搭建框架、实现各个框架中各个功效、添加引用与类。不过此次试验也让我认识到自己不足,造成完成作业整个过程比较艰苦。首先发觉自己在C#方面基础比较微弱,关键表现在,代码无法读懂;原理虽基础了解不过无法处理在此过程中碰到问题,只能多多寻求同学帮助;功效实现只能进行简单模仿,无法参透其中内涵。经过这个作业,让我明白了碰到问题只要去努力处理,不停思索、不停请教、不停尝试,就能够完成原定任务,达成目标。最终,这次作业极大提升了我对GIS爱好,以后将继续领会GIS精妙之处。
本文档为【2021年GIS实验报告】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: ¥20.0 已有0 人下载
最新资料
资料动态
专题动态
is_597436
暂无简介~
格式:doc
大小:665KB
软件:Word
页数:0
分类:教师资格考试
上传时间:2019-11-18
浏览量:52