cui老师复习提纲.doc_第1页
cui老师复习提纲.doc_第2页
cui老师复习提纲.doc_第3页
cui老师复习提纲.doc_第4页
cui老师复习提纲.doc_第5页
免费预览已结束,剩余16页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1 环境GIS的应用模式可以分为三种:作为环境科学研究工具的应用模式;作为环境管理的应用模式作为公众服务的应用模式;2 我国的环保机构分为四级管理机制:国家环保总局、省级环保局、市级环保局和县级环保局。相应地信息系统也分为四个层次:国家级;省级; 市级;县级。3 环境GIS涉及的空间信息主要有三大类:污染源空间信息环境质量空间信息自然生态空间信息。4 大气环境污染数据来源有两类:固定污染源和移动污染源。5 GIS从总体功能上划分,大致可分为:数据输入模块、数据处理模块、空间数据库管理模块、图像操作模块、控件分析模块、数字地形模型、制图输出模块、用户模型工具模块、应用界面模块等9大功能模块。6 应用型GIS开发又可分为 独立开发、单独二次开发 和 集成二次开发 三种实现方式。7 空气质量空间信息系统功能包括:污染源调查;模型计算;成果表现。8 环境数据分类:环境监测数据;工业污染与防治数据;生活及其他污染与防治数据;自然生态环境保护数据;环境管理数据。9 环境监测数据是环境GIS的主要数据源,而其获得的主要途径是通过环境监测体系。目前环境监测大体分为三个类型:要素型;管理型;混合型。10 GIS与面源模型集成的方法总的来说有两种,松散集成和紧密集成。11 软件生存期的阶段划分:可行性研究与计划、用户需求分析、 总体设计、详细设计、实现、集成测试确认测试和使用和维护。12 GIS中常用的数据模型有混合模型;扩展模型;面向对象模型。13 环境地理信息系统的总体框架14.AE 搭建系统框架步骤、重要代码模型结构地图显示空间查询分析模块地图编辑地图输出TOC图层显示鹰眼属性查询距离查询空间查询缓冲区分析专题图分析路径分析图形编辑属性编辑打印输出转换输出地图开关地图标注地图提示1. 新建WINDOWS窗体应用项目;2. 添加控件、设置控件属性及设置控件间关联;选择相关控件,拖到窗体中相关位置,1)菜单控件MenuStrip。2)工具条控件ToolbarControl,3)TOCContro,4)MapControl,5)LicenseControl;6)SpitContainer控件3. 添加引用;4. 编译运行;15、几个重要接口:属性、方法1、IMap接口:概念及功能:该接口主要用于管理Map对象中的图层对象、要素选择集和空间参考等对象。使用IMap接口,我们可以获取这个Map对象中的图层的个数,可以添加图层,删除图层,还可以利用IMap实现查询的高亮显示。方法1:IMap.SelectByShape方法:对地图中的要素进行查询。 Public void SelectByShape( IGeometry Shape,ISelectionEnvironment env,bool justOne);第一个参数是一个Geomtry对象,IMap.SelectByShape在查询的时候凡是和我们输入进去的这个几何对象相交的要素都会查询出来,但是这有一个前提就是每一个要素图层的Selectable属性是true。 第二个参数ISelectionEnvironment,该参数控制着构造选择集的结果和显示的方法等。第三个参数是一个bool值。 我们在MapControl控件中画一个多边形的面,查找出和我们这个多边形面相交的所有图层中的要素例子:IGeometry pGeo =axMapControl1.TrackPolygon();axMapControl1.Map.SelectByShape(pGeo, null, false);axMapControl1.ActiveView.Refresh();方法2:IMap.SelectFeature方法:将在Map中获得的一个要素放到这个要素的图层选择集中,这个方法有一个很重要的用途就是这个方法能使获取的要素高亮显示。Public void SelectFeature(Ilayer Layer,IFeature Feature);举例:void SearchHightlight(IMap _pMap, IFeatureLayer _pFeatureLayer, IQueryFilter _pQuery, bool _Bool) IFeatureCursor pFtCursor = _pFeatureLayer.Search(_pQuery, _Bool); IFeature pFt = pFtCursor.NextFeature(); while (pFt != null) _pMap.SelectFeature(_pFeatureLayer as ILayer, pFt); pFt = pFtCursor.NextFeature(); 方法3:public void AddLayer(Ilayer Layer)AddLayer方法向地图中添加图层。使用LayerCount属性获得地图中图层的总数。如果map没有设置坐标系统,AddLayer自动设置地图的SpatialReference属性。当地图的空间参考属性设置后,地图的MapUnits和DistanceUnits属性也就设置了。AddLayer同时也设置layer的空间参考。IMap接口的成员ActiveGraphicsLayer:活动图形图层,如果没有将创建一个基本memory graphics layer。AddLayer:向地图中添加单个图层。AddLayers:向地图中添加多个图层。AddMapSurround:向地图中添加map surround。AnnotationEngine:地图使用的注记(标签)引擎。AreaOfInterest:地图的感兴趣区域。Barriers:barriers列表和标签权重。BasicGraphicsLayer:基本图形层。ClearLayers:从地图中移除所有图层。ClearMapSurrounds:从地图中移除所有旁注。ClearSelection:清除地图选择。ClipBorder:ClipGeometry周围一个可选边界。ClipGeometry:地图图层中一个要剪切的形状。ComputeDistance:计算地图上两个点的距离并返回结果。CreateMapSurround:创建并初始化一个map surround。从样式集中指定一个可选样式。DelayDrawing:暂停绘制。DelayEvents:将操作按批组合来减少通知。DeletLayer:从map中删除图层。DeleteMapSurround:从地图中删除map surround。Description:地图描述。DistanceUnits:地图的距离单位。Expanded:指出地图是否可以扩张。FeatureSelection:地图中选择的要素。GetPageSize:获得地图的页面大小。IsFramed:指出地图是否在一个框架内而不是在整个窗口中绘制。Layer:给定序号的layer。LayerCount:地图中图层的数目。Layers:以uid表明类型的地图图层。如果recursive是true,将以layers的形式返回layers。MapScale:数字形式的地图比例尺。MapSurroundCount:与地图相关的旁注数量。MapUnits:地图单位。MoveLayer:将一个图层移到其他位置。Name:地图名称。RecalcFullExtent:重新计算全幅范围。ReferenceScale:分数形式的地图参考比例尺。SelectByShape:用一个几何形状和选择环境(可选)在地图中选择要素。SelectFeature:选择一个要素。SelectionCount:选择的要素的数目。SetPageSize:设置地图(可选)的页面大小。SpatialReference:地图的空间参考。SpatialReferenceLocked:指出是否允许改变空间参考。UseSymbolLevels:指出是否使用symbol levels绘制地图。AnnotationEngine:map使用的annotion(label)引擎。AreaOfInterest:地图的感兴趣区域。2、IGraphicsContainer接口:管理数据和地图元素、对象。AddElementAdd a new graphic element to the layer.AddElementsAdd new graphic elements to the layer.DeleteAllElementsDelete all the elements.DeleteElementDelete the given element.UpdateElementThe graphic elements properties have changed.3、IActiveView接口IActiveView接口定义了Map对象的数据显示功能,这个接口管理着绘制图形的显示范围。方法PartialRefresh,该方法可以让视图对象使用不同的方式来局部刷新以便重新绘制。Public void PartialRefresh(esriViewDrawPhase phase.object Data,IEnvelope envelope);ActivateGives this view control of the specified window.ClearEmpties the view contents.ContentsChangedCalled by clients when view objects are modified.DrawDraws the view to the specified device context.ExportFrameThe device rectangle to export.ExtentThe visible extent rectangle.FullExtentThe full extent rectangle.GraphicsContainerThe active graphics container.HitTestMapReturns any maps present in the view at the given location. Return value may be zero if there are no maps or the coordinate is not over a map.OutputRenders the view to the specified DC.PartialRefreshDraws the specified view phase. Use an envelope of zero to draw the entire phase.PrinterChangedCalled by application when printer changes.RefreshCauses the entire view to draw.ScreenDisplayThe screen display used by the view.SelectionThe selection.ShowSelectionIndicates if selection is visible.4、ILayer接口:是被图层(Layer)对象实现的,图层对象是用来在地图中显示空间信息,注意,图层不含有空间数据,它只是获取数据的一个引用层而已。图层对象是一个抽象对象,它定义了所有图层的公共方法和属性,它拥有很多子类,如IFeatureLayer,IGeoFeatureLayer,ICadFeatureLayer,IRasterLayer。图层相当于要素的载体,当用ArcMap将要素类打开后就成为了图层。AreaOfInterestlayer的默认兴趣区域。Cached指出layer是否需要显示缓存。Draw按照draw phase向指定的的display绘制图层。MaximumScale图层显示的最大比例尺。MinimumScale图层显示的最小比例尺。Name图层名字。ShowTips指出图层是否显示map tips。SpatialReference图层的空间参考。SupportedDrawPhases支持draw phases。TipText特定位置的地图提示内容。Valid指出图层当前是否有效。Visible指出图层是否可视。5、IFeatureLayer接口:用于管理要素类(Featureclass)图层的信息。方法IFeatureLayer.Search,用于对要素图层中符合要求的数据进行查询。Public IFeatureCursor Search(IQueryFilter queryFilter,bool recycling);如果图层定义了一个查询设置,搜索方法将在满足条件的要素子集中搜索。可以指定一个IQueryFilter对象作为参数进行查询。这个Search方法在连接字段上不起作用。如果要素图层有连接,使用IGeoFeatureLayer:SearchDisplayFeatures方法代替。不能使用IFeatureLayer:Search来更新要素,而应使用IFeatureClass:Update代替。Recycling指定结果要素cursor是recycling或non-recycling。True代表recycling cursor,False代表non-recycling cursor。AreaOfInterest图层的默认兴趣区域。Cached指出图层是否需要其自己的显示缓存。DataSourceType数据源类型。DisplayField主要的显示字段。Draw按照给定的phase将layer绘制到特定的display上。FeatureClass 图层的feature class。MaximumScale图层显示的最大比例尺。MinimumScale图层显示的最小比例尺。Name图层名称。ScaleSymbols指出符号是否随图层比例尺变化。Selectable指出图层是否可选。ShowTips指出图层是否显示map tips。SpatialReference图层的空间参考。SupportedDrawPhase支持的绘制模式。TipText指定位置的Map tip text。Valid指出是否有效。Visible指出图层是否可视。继承的接口ILayer访问所有图层的成员实现IFeatureLayer的类CadAnnotationLayerESRI Cad annotation图层。CadFeatureLayerESRI CAD要素图层类CoverageAnnotationLayerESRI coverage annotation图层。DimensionLayerdimension图层的属性集合。FDOGraphicsLayerannotation图层的属性集合(要素数据对象graphics图层)FeatureLayer要素集合和它们的可视化表达。GdbRasterCatalogLayerGeodatabase RasterCatalog数据源和显示选项。IMSSubFeatureLayerIMS Sub-FeatureLayer类。MADtedLayer()用来控制MADTED目录显示的图层。MARasterLayer()用来控制MARPF目录显示的图层。TmporalFeatureLayer(TrackingAnalyst)定义TemporalFeatureLayer COM对象的组件类IDL参数和属性。6、IGeoFeaturelayer接口:该接口主要用于控制要素图层中宇地理相关的内容,如要素类着色和渲染,以及空间范围等。属性IGeoFeatureLayer.Renderer,使用这个属性,我们就可以对空间数据符号化。Public IFeatureRenderer Rendererget;set;AnnotationPropertiesAnnotation properties.AnnotationPropertiesIDThe UID used for annotation properties.AreaOfInterestThe default area of interest for the layer.CachedIndicates if the layer needs its own display cache.CurrentMapLevelCurrent map level for drawing symbols.DataSourceTypeData source type.DisplayAnnotationIndicates if the layer displays annotation.DisplayFeatureClassFeature class used for display operations (may include joined fields).DisplayFieldPrimary display field.DrawDraws the layer to the specified display for the given draw phase.ExclusionSetThe set of features that are excluded from drawing.FeatureClassThe layers feature class.MaximumScaleMaximum scale (representative fraction) at which the layer will display.MinimumScaleMinimum scale (representative fraction) at which the layer will display.NameLayer name.RendererRenderer used to draw the layer.RendererPropertyPageClassIDClass id of the property page for the renderer.ScaleSymbolsIndicates if symbols are scaled for the layer.SearchCreates a cursor based upon the search criteria.SearchDisplayFeaturesCreates a cursor from the display feature class based upon the search criteria.SelectableIndicates if layer is selectable.ShowTipsIndicates if the layer shows map tips.SpatialReferenceSpatial reference for the layer.SupportedDrawPhasesSupported draw phases.TipTextMap tip text at the specified location.ValidIndicates if the layer is currently valid.VisibleIndicates if the layer is currently visible.例子:/利用IGeoFeatureLayer接口进行相关设置IGeoFeatureLayergFeaLayer = this.axMapControl1.Map.get_Layer(0) as IGeoFeatureLayer;if (gFeaLayer = null)return;/将FeatureLayer对应表中的某一字段设为显示字段gFeaLayer.DisplayField= Name;/将是否显示Tip设置为truegFeaLayer.ShowTips= true;16.ADO.NET 数据库查询步骤、涉及的类,重要代码步骤:c#利用进行数据库开发的基本步骤:1、创建和数据库连接的connection 对象。2、配置DataAdapter对象并创建和操作数据集DataSet。3、将数据库中的表添加到DataSet中。4、把数据集DataSet绑定到DataGrid上。利用DataAdapter 的Fill方法把数据填充到DataSet,最终的数据库中的数据显示在用户界面的DataGrid中。1)指定数据库连接 :使用连接对象来:选择连接类型;指定数据源;连接到数据源,使用 ConnectionString 属性指定。 string connectionStr = Data Source”=localhost; Integrated Security=SSPI;Initial Catalog=northwind;2)指定 Command 1. 创建数据库连接SqlConnection conn = new SqlConnection(connString);打开与数据库的连接:conn.Open();2. 定义SQL语句String sql = “”;3. 创建Command语句SqlCommand cmd = new SqlCommand(sql,conn);3)创建 DataAdapter 对象 SqlDataAdapter 对象名 = new SqlDataAdapter(查询用sql语句, 数据库连接);4)创建 DataSet 对象 DataSet dataSet = new DataSet(“可选可不填”);5)将 DataSet 绑定到 DataGrid DataGrid dataGrid1 = new DataGrid();sqlDataAdapter1.Fill(dataSet1, Customers);sqlDataAdapter2.Fill(dataSet1, Orders);dataGrid1.DataSource = dataSet1;6)在 Visual Studio .NET 中使用数据向导 7)执行查询:下面的示例程序完成的功能是访问sqlserver数据库,并使用datareader从northwind数据中读取记录,并将查询结果通过控制台输出。程序代码代码 using System;using System.Data;using System.Data.SqlClient;namespace ReadDataFromDBclass Class1static void Main(string args)string myconn=Data Source=localhost;Integrated Security=SSPI;Initial Catalog=Northwind;/需要执行的SQL语句string mysql=select orderID,CustomerID from orders where CustomerID=CHOPS;/打开数据库连接。 SqlConnection myconnection=new SqlConnection(myconn);myconnection.Open(); /创建SqlCommand 对象SqlCommand mycommand=new(mysql,myconnection); /通过SqlCommand的ExecuteReader()方法构造DataReader 对象。SqlDataReader myreader=mycommand.ExecuteReader();while(myreader.read()Console.WriteLine(myreader.GetInt32(0)+,+myreader.GetString(1);myreader.Close();myconnection.Close();使用 DataReader 检索数据的步骤:1、创建 Command 对象2、调用 ExecuteReader() 创建 DataReader 对象3、使用 DataReader 的 Read() 方法逐行读取数据4、读取某列的数据,(type)dataReader 5、关闭 DataReader 对象string sql = SELECT StudentName FROM Student WHERE StudentName LIKE 李%;SqlCommand command = new SqlCommand(sql, connection);connection.Open();SqlDataReader dataReader = command.ExecuteReader();Console.WriteLine(查询结果:);while (dataReader.Read() Console.WriteLine(string)dataReaderStudentName);dataReader.Close(); 对数据库中的数据增删改(使用Command对象的ExecuteNonQuery()方法)ExecuteNonQuery()方法用于执行指定的SQL语句,如:update、insert、delete,它返回的是受SQL语句影响的行数使用Command对象的ExecuteNonQuery()方法的步骤如下:1 创建Connection对象2 定义要执行的SQL语句3 创建Command对象4 执行ExecuteNonQuery()方法5 根据返回结果,进行后续处理ADO.NET的数据访问对象是以下几个:1、Connection对象:与数据源建立连接,连接sql server7.0 或更新版本数据库用SqlConnection,连接OLEDB数据源使用OledbConnection.2、Command 对象:对数据源执行SQL命令并返回结果,SQL Server7.0或更新版本用SqlCommand,OLE DB数据源使用OledbCommand.3、DataReader对象: 读取数据源的数据,只能将数据源的数据从头到尾依次读出,Sql server7.0或以上版本使用SqlDataReader,Oledb数据源使用OledbReader4、DataAdapter对象:对数据源执行操作并返回结果,在DataSet与数据源之间建立通信,将数据源中的数据写入DataSet ,或根据DataSet中的数据必定数据源。Sql server7.0或以上版本使用SqlDataAdapter,Oledb 数据源使用OledbAdpater.5、DataSet对象:服务器内存中的数据库6、DataView对象:用于显示DataSet中的数据 #region 菜单栏打开地图文档 IMapDocument pMapDoc; private void 打开ToolStripMenuItem_Click(object sender, EventArgs e) System.Windows.Forms.OpenFileDialog openFileDialog1; openFileDialog1 = new OpenFileDialog(); openFileDialog1.Title = Open Map Document; openFileDialog1.Filter = Map Documents (*.mxd)|*.mxd; openFileDialog1.ShowDialog(); string sFilePath = openFileDialog1.FileName; if (axMapControl1.CheckMxFile(sFilePath) pMapDoc = new MapDocumentClass(); axMapControl1.MousePointer = esriControlsMousePointer.esriPointerHourglass; if (sFilePath = ) return; /将数据载入pMapDocument并与map控件联系起来 pMapDoc.Open(sFilePath, ); /IMapDocument对象中可能有多个Map对象,遍历每个map对象 for (int i = 0; i pMapDoc.MapCount; i+) axMapControl1.Map = pMapDoc.get_Map(i); axMapControl1.MousePointer = esriControlsMousePointer.esriPointerDefault; else MessageBox.Show(sFilePath + 不是有效的地图文档); return; /刷新地图 axMapControl1.Refresh(); #endregion #region 菜单栏保存地图文档 private void 保存ToolStripMenuItem_Click(object sender, EventArgs e) try /判断pMapDocument是否为空,否则将取消保存 if (pMapDoc = null) /判断pMapDocument是否为空, /获取pMapDocument对象 IMxdContents pMxdC; pMxdC = axMapControl1.Map as IMxdContents; IMapDocument pMapDocument = new MapDocumentClass(); /获取保存路径 System.Windows.Forms.SaveFileDialog saveFileDialog1; saveFileDialog1 = new SaveFileDialog(); saveFileDialog1.Filter = mxd 文件(*.mxd)|*.mxd; saveFileDialog1.Title = 保存; DialogResult pDialogResult = saveFileDialog1.ShowDialog(); if (pDialogResult != DialogResult.OK) return; pMapDocument.New(saveFileDialog1.FileName); pMapDocument.ReplaceContents(pMxdC); /保存地图文档 pMapDocument.Save(true, true); MessageBox.Show(地图文档保存成功!); else /检查地图文档是否是只读 if (pMapDoc.get_IsReadOnly(pMapDoc.DocumentFilename) = true) MessageBox.Show(本地图文档是只读的,不能保存!); return; pMapDoc.Save(pMapDoc.UsesRelativePaths, true); MessageBox.Show(地图文档保存成功!); catch (Exception ex) MessageBox.Show(ex.Message); #endregion private void axMapControl1_OnMouseDown(object sender, IMapControlEvents2_OnMouseDownEvent e) if (bool_图查属性) ILayer pLayer; IFeatureLayer pFL; IFeatureSelection pFeatureSelection; IEnvelope pEnv; IGeometry pGeometry; ISpatialFilter pSpatialFilter; ISelectionSet pSelectionSet; IEnumIDs pEnumIDs; IFeature pFeature; pEnv = new EnvelopeClass(); double ext = 0; IEnvelope mapExt = this.axMapControl1.Extent; int mapWidth = this.axMapControl1.Right - this.axMapControl1.Left; ext = 5 * (mapExt.XMax - mapExt.XMin) / mapWidth; pEnv.Pu

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论