ArcGIS Engine 中的地图组成及图层控制._第1页
ArcGIS Engine 中的地图组成及图层控制._第2页
ArcGIS Engine 中的地图组成及图层控制._第3页
ArcGIS Engine 中的地图组成及图层控制._第4页
ArcGIS Engine 中的地图组成及图层控制._第5页
已阅读5页,还剩30页未读 继续免费阅读

下载本文档

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

文档简介

1、湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 第六讲 地图组成及图层控制 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 主要内容 4 Element对象 1 2 3 5 MapGrid对象 MapSurround对象 Style对象 添加、删除图层数据 6 图层控制 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市

2、政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 一、Element对象 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 一、 Element对象 v如何理解如何理解Element对象对象? 在Map对象和PageLayout对象显示的数据除了地理数据 之外,另一种即为元素数据(Element对象)。 Graphics Element都是作为图形的形式而存在,在Map 视图或者PageLayout视图上是可见的; Frame Element是作为不可见的容器而存

3、在的。 Map对象或者PageLayout对象可以通过IElement接口和 IGraphicsContainer接口来管理Element对象。 IGraphicsContainer接口添加、删除、更新Element; IElement确定Element对象的Geometry属性。 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 一、 Element对象-Graphics Element v1、LineElement 在Map视图或PageLayout视图中表现为线的形式。 Li

4、neElement实现了ILineElement接口,ILineElement接 口只提供了Symbol属性,用于设置线的样式。 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 一、 Element对象-Graphics Element v2、MarkerElement 在Map视图或PageLayout视图中表现为点的形式。 MarkerElement实现了IMarkerElement接口, IMarkerElement接口只提供了Symbol属性,用于设置点 的样式。 湖南湖

5、南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 一、 Element对象-Graphics Element v3、TextElement 地图标注存在两种形式: 一种是保存在地理数据库中的标注; 另一种是使用TextElement。 TextElement实现了ITextElement接口,ITextElement提 供了三个属性: ScaleText文字尺寸; Text字符; Symbol文字符号。 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine

6、 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 一、 Element对象-Graphics Element v4、GroupElement GroupElement对象就是将多个Element对象编为一组, 作为一个整体使用。 GroupElement对象实现了IGroupElement接口,该接口 定义了6个属性和方法。 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 一、 Element对象-Graphics Element v4、GroupE

7、lement 例:在PageLayout视图中添加GroupElement IGraphicsContainer pGC = this.axPageLayoutControl1.PageLayout as IGraphicsContainer; IGroupElement pGroupElement; pGroupElement = this.pJtGrid.JtGrids; if (pGroupElement != null) pGC.AddElement(pGroupElement as IElement,0); 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS En

8、gine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 一、 Element对象-Graphics Element v5、FillShapeElement FillShapeElement泛化出了CircleElement、 EllipseElement、PolygonElement和RectangleElement 等。 FillShapeElement实现了IFillShapeElement接口,该接 口的Symbol属性,可以设置元素的样式。 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地

9、理信息系统专业市政与测绘工程学院地理信息系统专业 一、 Element对象-Graphics Element v6、PictureElement 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 一、 Element对象-Graphics Element 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 一、 Element对象-Frame Element vMapFr

10、ame和和MapSurroundFrame Frame Element主要有两个对象:MapFrame(地图框架) 和MapSurroundFrame(地图修饰框架)。 MapFrame对象是Map对象的的容器,用于管理Map对象; MapSurroundFrame用于管理MapSurround(比例尺、 比例文本、指北针等)对象。 MapSurroundFrame对象与MapFrame对象相连,当删除 MapFrame时, MapSurroundFrame也将被删除。 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统

11、专业市政与测绘工程学院地理信息系统专业 二、MapGrid对象 v如何理解如何理解MapGrid对象?对象? MapGrid是布局 视图中的一系列 参考线和参考点, 用来帮助地图使 用者快速地确定 地图要素的位置。 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 二、 MapGrid对象 v如何理解如何理解MapGrid对象?对象? 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地

12、理信息系统专业 二、 MapGrid对象 v如何理解如何理解MapGrid对象?对象? 不同类型的MapGrid 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 二、 MapGrid对象 v如何理解如何理解MapGrid对象?对象? MapGrid对象实现了IMapGrid接口。 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 三、MapSurround对象 v如何

13、理解如何理解MapSurround对象?对象? 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 三、 MapSurround对象 v如何理解如何理解MapSurround对象?对象? 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 三、 MapSurround对象-图例对象 v如何理解图例对象?如何理解图例对象? InterfacesDescription IAct

14、iveViewEventsProvides access to events that occur when the state of the active view changes. IBoundsPropertiesProvides access to members that control Bounds Properties. IClone (System)Provides access to members that control cloning of objects. IConnectionPointContainerSupports connection points for

15、connectable objects. IGraphicsCompositeProvides access to members that control objects that are composed of graphic elements. ILegendProvides access to members that control a legend. ILegend2Provides access to additional members that control a legend. IMapSurroundProvides access to members that cont

16、rol the map surround. IPersistDefines the single method GetClassID, which is designed to supply the CLSID of an object that can be stored persistently in the system. IPersist is the base interface for three other interfaces: IPersistStorage, IPersistStream, and IPersistFile. IPersistStream (System)

17、IPropertySupport (System)Provides access to members that set a default property on an object. IQuerySizeProvides access to means to getting the size of an element. IReadingDirectionProvides access to members that control the reading direction. ITransformEvents (Display)Provides access to members tha

18、t control Transform Events. 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 三、 MapSurround对象-图例对象 v如何理解图例对象?如何理解图例对象? Description AddItemAdds a new item to the legend (to the end of the list). AutoAddIndicates if a new item should be added when a new layer is added

19、to the map. AutoReorderIndicates if the legend items should be kept in the same order as the layers. AutoVisibilityIndicates if items should be shown only when associated layers are visible. ClearItemsRemoves all items from the legend. DelayEventsUsed to batch operations together to minimize notific

20、ations. DrawDraws the map surround into the specified display bounds. FitToBoundsAdjusts the map surround to fit the bounds. The changed argument indicates whether the size of the map surround was changed. FlowRightReserved for future use. FormatThe formatting options for the legend (can be stored i

21、n the style gallery). IconIcon used to represent the map surround. InsertItemInserts a new item into the legend (at the location specified by index). ItemThe specified item from the legend. ItemCountNumber of items in the legend. MapThe parent map. NameName of the map surround. QueryBoundsReturns th

22、e bounds of the map surround. RefreshMakes sure the latest updates are refected the next time the Map Surround is drawn. RemoveItemRemoves the specified item from the legend. TitleTitle. ILegend接口 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 三、 MapSurround对象-指北针对

23、象 v如何理解指北针对象?如何理解指北针对象? 指北针对象(MarkerNorthArrow)实现了 IMarkerNorthArrow接口。 Description MarkerSymbolSymbol used to draw the north arrow. Use set to specify a marker for custom north arrows. 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 三、 MapSurround对象-比例尺对象 v如何理解比例尺对

24、象?如何理解比例尺对象? 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 三、 MapSurround对象-比例尺对象 v如何理解比例尺对象?如何理解比例尺对象? InterfacesDescription IBoundsPropertiesProvides access to members that control Bounds Properties. IClone (System)Provides access to members that control cloning

25、 of objects. IConnectionPointContainerSupports connection points for connectable objects. IMapSurroundProvides access to members that control the map surround. IPersistDefines the single method GetClassID, which is designed to supply the CLSID of an object that can be stored persistently in the syst

26、em. IPersist is the base interface for three other interfaces: IPersistStorage, IPersistStream, and IPersistFile. IPersistStream (System) IQuerySizeProvides access to means to getting the size of an element. 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 三、 MapSurr

27、ound对象-比例文本对象 v如何理解比例文本对象?如何理解比例文本对象? 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 四、Style对象 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 四、 Style对象 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息

28、系统专业 四、 Style对象 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 五、添加、删除图层 v如何添加如何添加shp图层?图层? / / 添加Shape文件 / / Shape文件所在的目录 / Shape文件名城,不要后缀,不要目录 public void LoadShapeFile(string ShapeFilePath, string ShapeFileName) Debug.Assert(pMap != null, Map is null); IWorkspac

29、eFactory pWorkFactory = new ShapefileWorkspaceFactoryClass(); IPropertySet pSet = new PropertySetClass(); pSet.SetProperty(DATABASE, ShapeFilePath); IWorkspace pWorkSpace = pWorkFactory.Open(pSet, 0); IFeatureWorkspace pFeatWorkSpace = pWorkSpace as IFeatureWorkspace; IFeatureClass pFeatClass = pFea

30、tWorkSpace.OpenFeatureClass(ShapeFileName); ILayer pLayer = new FeatureLayerClass(); (pLayer as IFeatureLayer).FeatureClass = pFeatClass; pMap.AddLayer(pLayer); 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 五、添加、删除图层 v如何添加如何添加Access数据库数据?数据库数据? / / 装载Access数据库数据 /

31、 / Access数据库文件名称 / 需要装载的图层名称 public void LoadAccessLayer(string AccessFileName, string FeatClassName) Debug.Assert(pMap != null, Map is null); IWorkspaceFactory pWorkFactory = new AccessWorkspaceFactoryClass(); IPropertySet pSet = new PropertySetClass(); pSet.SetProperty(DATABASE, AccessFileName); I

32、Workspace pWorkSpace = pWorkFactory.Open(pSet, 0); IFeatureWorkspace pFeatWorkSpace = pWorkSpace as IFeatureWorkspace; IFeatureClass pFeatClass = pFeatWorkSpace.OpenFeatureClass(FeatClassName); ILayer pLayer = new FeatureLayerClass(); (pLayer as IFeatureLayer).FeatureClass = pFeatClass; pMap.AddLaye

33、r(pLayer); 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 五、添加、删除图层 v如何添加如何添加Coverage数据?数据? / / 装载Coverage数据 / / Coverage数据所在的目录名称 / Coverage图层名称,不包含后缀 public void LoadCoverageLayer(string CoverageFilePath, string FeatClassName) Debug.Assert(pMap != null, Map is nu

34、ll); IWorkspaceFactory pWorkFactory = new ArcInfoWorkspaceFactoryClass(); IPropertySet pSet = new PropertySetClass(); pSet.SetProperty(DATABASE, CoverageFilePath); IWorkspace pWorkSpace = pWorkFactory.Open(pSet, 0); IFeatureWorkspace pFeatWorkSpace = pWorkSpace as IFeatureWorkspace; IFeatureClass pF

35、eatClass = pFeatWorkSpace.OpenFeatureClass(FeatClassName); ILayer pLayer = new FeatureLayerClass(); (pLayer as IFeatureLayer).FeatureClass = pFeatClass; pMap.AddLayer(pLayer); 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用ArcGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 五、添加、删除图层 v如何添加装载图片文件?如何添加装载图片文件? / / 装载图片

36、文件 / / 图片所在的目录名称 / 图片文件名称 public void LoadImageLayer(string ImageFilePath, string ImageFileName) Debug.Assert(pMap != null, Map is null); IWorkspaceFactory pWorkFactory = new RasterWorkspaceFactoryClass(); IPropertySet pSet = new PropertySetClass(); pSet.SetProperty(DATABASE, ImageFilePath); IRaster

37、Workspace rasterWorkspace = pWorkFactory.Open(pSet, 0) as IRasterWorkspace; IRasterDataset rasterDS = rasterWorkspace.OpenRasterDataset(ImageFileName); ILayer pLayer = new RasterLayerClass(); (pLayer as IRasterLayer).CreateFromDataset(rasterDS); pMap.AddLayer(pLayer); 湖南湖南 城市学院城市学院 GIS二次开发二次开发使用使用Ar

38、cGIS Engine 9.3 市政与测绘工程学院地理信息系统专业市政与测绘工程学院地理信息系统专业 五、添加、删除图层 v如何装载如何装载SDE图层?图层? / / 装载SDE图层 / / 服务器名称 / SDE实例名称 / 数据库名称 / 用户名称 / 用户口令 / SDE版本 / 需要装载的FeatuerClass的名称 / 图层过滤条件 public void LoadSDELayer(string ServerName, string InstanceName, string DbName, string UserName, string Password,string SdeVersion, string FeatClassName,string Filter) Debug.Assert(pMap != null, Map is null); IPropertySet pSet = new PropertySetClass(); pSet.S

温馨提示

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

评论

0/150

提交评论