




已阅读5页,还剩62页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
ArcGISEngine基础介绍 Esri西安分公司姚啸 介绍内容 ArcGISEngine简介创建第一个ArcGISEngine程序练习DEMO ArcGISEngeine简介 ArcGISEngineDeveloperKit 开发包是组件 APIs和工具的集合开发人员可以用来创建高级的GIS应用组件Engine库 制图 绘制 选择 编辑等Control库 地图控件 布局控件 工具条等APIsCOM NET Java C 工具文档 开发工具 ArcGISEngine功能框架 基本服务应用层需要用到的ArcObjects核心对象几何图形的操作与显示数据访问地理数据集 矢量 栅格数据地图分析属性 空间查询 地理数据处理地图显示渲染 标注 制图表达开发组件各种应用层面上的Control及Commands Tools Engine库 组件库 ArcGISEngine核心组件库 SystemSystemUICartoControlsGeometryDisplayGeoprocessingGeoprossorGlobeCoreOutput GeodatabaseDataSourcesGDBDataSourcesFileDataSourcesOleDBDataSourcesRasterGeoDatabaseDistributedServer GISClient 扩展模块 常用名词 DocumentMapLayerFeaturerLayerFeatureClassCursorRowGeometryFeatureElement 主要类库介绍 System SystemUI SystemSystem库是ArcGISEngine框架中最底层的一个库 它包含了一些被其他库使用的一些组件 AoInitialize Array EnvironmentManager FileStream JSONReader ObjectCopy PropertySet Time UIDSystemUISystemUI库定义了一些在ArcGIS中被用户界面组件使用的类型 象ICommand和ITool这样的接口就在这里定义 IArcGISSingleSignon ICommand IOperationStack ITool 主要类库介绍 Carto CartoCarto库包含了为数据显示服务的对象 PageLayout和Map对象在这个库中 以及支持各种数据类型的图层 渲染 主要包括Element Renderer Layer Symbol的具体实现 AnnotationFeature BasemapLayer CacheInfo CadLayer FeatureLayer GraphicFeature GroupLayer Legend Map MapDocument MapImage MapServer MosaicLayer Page PageLayout RasterLayer RelateInfo TerrainLayer TinLayer WCSLayer WMSLayer Carto库的Map PageLayout Element Carto库的Layer Carto库的Render 主要类库介绍 Control Controls控件库包含了应用程序开发中用到的控件 包括在控件中使用的命令和工具 CommandPool ControlsEditingEditTool ControlsEditingToolbar CustomizeDialog EngineEditor EngineFeatureSnap GlobeControl HookHelper LicenseControl MapControl PageLayoutControl SceneControl Snapping Symbology TOCControl ToolbarControl ToolbarItem 主要类库介绍 Display Display显示库包含了支持在输出设备上显示图形的组件 屏幕显示 符号 颜色等都在这个库中定义 BalloonCallout ScreenDisplay绘图跟踪器 EngineRotateTracker EnvelopeTracker 字体 颜色 RgbColor CmykColor点 线 面符号样式 简单符号 图片符号 专题符号制图表达 RepresentationRule 符号库 ServerStyleGallery ServerStyleGalleryItem 主要类库介绍 Geometry Geometry几何库包含了核心的几何对象 比如点 线 面等 在几何库中还定义和实现了空间参考的对象 包括投影坐标系和几何坐标系 单位 AngularUnit LinearUnit 几何体 点 多点 线 曲线 圆弧 椭圆弧 多边形 矩形 多面空间参考 Datum GeographicCoordinateSystem Projection ProjectedCoordinateSystem Spheroid ITransform2D ITransform3D ITransformation 主要类库介绍 GeodataBase GeoDatabaseGeoDatabase包含了所有相关数据组织的定义类型 要素 表 网络 TIN都在这个库中定义 其中一些类型的实现在各自的数据来源的库中 IArchivableClass IAttachment IDataStatistics IFeature IFeatureClass IFeatureCursor IFeatureDataset IFeatureWorkspace IField IGeometricNetwork INetwork INetworkDataset IPixelBlock IQueryFilter IRaster IRasterCursor IRasterDataset IRelationship IReplica ISelectionSet ISurface ITin ITopology IVersion 主要类库介绍 GeodataBase DataSourcesFile包含了为支持的矢量数据格式提供的工作空间工厂和工作空间 ICoverageFeatureClass ICadDrawingLayers IGPLayer ArcInfoWorkspaceFactory CadWorkspaceFactory SDCWorkspaceFactory ShapefileWorkspaceFactory TinWorkspaceFactory VpfWorkspaceFactoryDataSourcesRasterDataSourcesRaster包含了为基于文件方式的栅格数据提供的工作空间工厂和工作空间 栅格函数 MosaicFunction PixelBlock RasterBand RasterStatistics RasterWorkspace 主要类库介绍 GeodataBase DataSourcesGDB包含了为存储在数据库中的矢量和栅格数据提供的工作空间工厂和工作空间 AccessWorkspaceFactory FileGDBWorkspaceFactory SdeWorkspaceFactory SqlWorkspaceFactoryDataSourcesOleDB为通过OleDB方式提供的数据提供空组空间 ExcelWorkspaceFactory FdoAdoConnection OLEDBWorkspaceFactory TextFileWorkspaceFactoryGeoDatabaseDistributed包含了需要执行的离线编辑的GeoDatabase对象 ICheckIn ICheckOut IDataChanges IReplicationAgent IReplicaDataChanges Control库 组件库 开发控件 ArcGISEngine中提供了丰富的开发控件LicenseControlMapControlPageLayoutControlTOCControlToolbarControlSymbologyControlGlobeControlSceneControl MapControl MapControl封装Mapcoclass绘制单DataFrame用来分析和浏览暴露鼠标和绘制事件装载地图文档和其它文件设置当前工具库MapControl ocx MapControl 数据的访问IMapControl3 IPageLayoutControl2CheckMxFileLoadMxFileReadMxMaps关联map对象 事件IMapControlEvents IPageLayoutControlEventsOnAfterDraw OnBeforeScreenDraw OnAfterScreenDraw OnExtentUpdated OnMouseDown Up Move OnKeyDown Up OnOleDrop OnViewRefreshed OnMap PageReplaced MapControl对象 通过Map你可以访问所有的对象LayersRenderersSymbolsFeatureClassesWorkspaces 使用map和layers属性 提供直接访问Map和Layer对象的方法属性IMapControl3AddLayerFromFile AddShapeFile AddLayer DeleteLayer MoveLayerTo Layer Map 设置地图的可视化区域 控制显示的可视区域可以设置多种shapes geometries IMapControl3VisibleRegionaxMapControl1 VisibleRegion extent 在地图上显示提示 可以为图层设置提示步骤设置ILayer ShowTips在鼠标移动时显示提示文本使用ToolTip控件来显示提示文本 ILayerlayer axMapControl1 get Layer 0 layer ShowTips true ToolTiptootip1 newToolTip tootip1 SetToolTip axMapControl1 这是一个提示 PageLayoutControl控件 PageLayoutControl封装PageLayoutcoclass绘制地图元素创建版面视图打印设置当前工具加载地图文档库PageLayoutControl ocx PageLayoutControl控件 使用PageLayout来访问其它对象Elements 例子代码MapElements FrameElementsMapFrameMapSurroundFrameGraphicElementsPictureElements 使用elements 关于elements有很多高级的成员函数IPageLayoutControlAddElementFindElementByNameLocateFrontElementGraphicsContainer 地图上显示查询结果element 查询结果的渲染 ISimpleMarkerSymbolsimpleMarkerSymbol newSimpleMarkerSymbolClass simpleMarkerSymbol Color rgb simpleMarkerSymbol Size 30 IMarkerElementmarkerElement newMarkerElementClass markerElement Symbol simpleMarkerSymbol element IElement markerElement element Geometry point graphicsContainer IGraphicsContainer map graphicsContainer AddElement element 0 使用地图文档 MXD文件是结构化的存储文档 保存路径 通常由ArcMap创建包含持久对象Maps Layers PageLayout MapDocument使以下成为可能读取mxd lyr mxt andpmffiles写新的mxdfiles访问mapdocument的内容 IMapDocument与mxd 读取和写地图文档的成员函数Open 打开已经存在的地图文档 mxd mxt lyr pmf SaveAs 保存当前文档到新的文件CheckMxFile 检查mxd是否存在LoadMxFile 加载mxd文档ReadMxMaps 读mxd文档New 新建mxd文档Save 保存mxd文档 加载mxd LoadMxFile if openFileDialog2 ShowDialog DialogResult OK stringFilePath openFileDialog2 FileName if axMapControl1 CheckMxFile FilePath axMapControl1 MousePointer ESRI ArcGIS Controls esriControlsMousePointer esriPointerHourglass axMapControl1 LoadMxFile FilePath 0 Type Missing axMapControl1 MousePointer ESRI ArcGIS Controls esriControlsMousePointer esriPointerDefault else MessageBox Show FilePath isnotavaildArcMapdocument return 访问地图文档中的对象 控件可以直接引用对象 MapandPageLayout 或访问自己的拷贝Reference直接Copy使用ObjectCopy避免共享引用深度复制 IMapDocumentmapdoc newMapDocument axMapControl1 Map mapdoc get Map 0 IObjectCopyobjectcopy newObjectCopyClass IPageLayoutpagelayout objectcopy Copy mapdoc PageLayout asIPageLayout 框架控件 ToolbarControl和TOCControl被设计成和其它控件协同工作通过一个buddy控件自动捆绑在一起根据彼此的状态通信和同步例子 activetool layervisibility BuddyControl Toolbar TOC 命令和工具 提供超过100个工具和命令 TocControl 显示所有的图层和符号Simplesymbols renderersGrouplayers控制图层可视性必须调用SetBuddyControl库TOCControl ocx ToolbarControl 自定义commands tools和menus的容器允许命令和以下控件对象进行交互Map PageLayout Scene 和Globe必须调用SetBuddyControl库ToolbarControl ocx 制图控件命令 系统提供的控件命令 工具 工具条 和菜单命令和工具漫游 缩放 打开地图 图形绘制 工具条要素选择 绘图 地图导航 和pagelayout菜单要素选择和地图浏览库esriCommandControls olb参考对象模型图或技术文档 创建第一个ArcGISEngeine应用程序 创建一个控件应用程序使用控件成员使用工具条和TOC控件加载MXD文档保存mxd文档打开shp 开发环境 COMVisualStudio6 0 VB VC Delphi ArcGISEngine10不再支持VB6 0 NETVisualStudio NET VB NET C VC NET ArcGISEngine10 1不支持VS2008C VisualStudio6 0 BorlandC Builder C JavaJBuilder Eclipse JDK 开发环境 安装VS2012安装ArcGISSDKDeveloperKit ArcGISEngine 许可授权 创建第一个ArcGISEngine应用程序模板 新建MapControl工程 创建第一个ArcGISEngine应用程序模板 创建第一个ArcGISEngine应用程序模板 增加一个菜单功能 创建自定义应用程序 创建自定义应用程序 添加控件 创建自定义应用程序 为toolbar添加工具 控件绑定 将toolbar和mapcontrol绑定 注意 许可绑定 if RuntimeManager Bind ProductCode Engine if RuntimeManager Bind ProductCode Desktop MessageBox Show UnabletobindtoArcGISruntime Applicationwillbeshutdown return 打开mxd if openFileDialog2 ShowDialog DialogResult OK stringFilePath openFileDialog2 FileName if axMapControl1 CheckMxFile FilePath axMapControl1 MousePointer ESRI ArcGIS Controls esriControlsMousePointer esriPointerHourglass axMapControl1 LoadMxFile FilePath 0 Type Missing axMapControl1 MousePointer ESRI ArcGIS Controls esriControlsMousePointer esriPointerDefault else MessageBox Show FilePath isnotavaildArcMapdocument return 打开shp 打开shp axMapControl1 Map ClearLayers IWorkspaceFactorypWorkspaceFactory IFeatureWorkspacepFeatureWorkspace IFeatureLayerpFeatureLayer this openFileDialog1 Filter shp文件 shp if this openFileDialog1 ShowDialog DialogResult OK this textBox1 Text this openFileDialog1 FileName ToString stringstrFullPath openFileDialog1 FileName if strFullPath return intIndex strFullPath LastIndexOf stringfilePath strFullPath Substring 0 Index stringfileName strFullPath Substring Index 1 打开工作空间并添加shp文件pWorkspaceFactory newShapefileWorkspaceFactoryClass 创建工作空间pFeatureWorkspace IFeatureWorkspace pWorkspaceFactory OpenFromFile filePath 0 打开矢量数据所在的空间pFeatureLayer newFeatureLayerClass 创建一个要素图层pFeatureLayer FeatureClass pFeatureWorkspace OpenFeatureClass fileName 将要素类加如到要素图层pFeatureLayer Name pFeatureLayer FeatureClass AliasName 将要素类的名称赋值给要素图层axMapControl1 Map AddLayer pFeatureLayer 将图层加到地图控件axMapControl1 ActiveView Refresh 刷新地图 保存mxd IMapDocumentmapDoc4 newMapDocumentClass mapDoc4 New F teuu5 mxd IMxdContentsmxdContents axMapControl1 MapasIMxdContents mapDoc4 ReplaceContents mxdContents mapDoc4 Save false true mapDoc4 Close 练习DEMO 打开数据源 打开gdbIWorkspaceFactoryworkspaceFactory newFileGDBWorkspaceFactoryClass workspace workspaceFactory OpenFromFile D data gdb 0 IFeatureWorkspacepFeatWorkspace workspaceasIFeatureWorkspace IFeatureClasspFeatureClass pFeatWorkspace OpenFeatureClass Water 打开sdeIPropertySetpropertySet newPropertySetClass propertySet SetProperty SERVER server propertySet SetProperty INSTANCE instance propertySet SetProperty DATABASE database propertySet SetProperty USER user propertySet SetProperty PASSWORD password propertySet SetProperty VERSION version IWorkspaceFactoryworkspaceFactory newSdeWorkspaceFactoryClass workspace workspaceFactory Open propertySet 0 属性查询 ILayerlayer axMapControl1 get Layer 0 IFeatureLayerfeatureLayer layerasIFeatureLayer 获取featureLayer的featureClassIFeatureClassfeatureClass featureLayer FeatureClass IQueryFilterqueryFilter newQueryFilterClass IFeatureCursorfeatureCusor stringfilter DLMC 旱地 queryFilter WhereClause filter featureCusor featureClass Search queryFilter true if featureCusor null IFeaturefea featureCusor NextFeature while fea null if featureCusor null return IGeometrygeom fea Shape IPolygonpolygon geomasIPolygon Common renderPolygon polygon axMapControl1 ActiveView axMapControl1 Map fea featureCusor NextFeature 查询所有旱地 绘制多边形 IFillShapeElementpPolygonElement ISimpleFillSymbolpSimpleFillSymbol newSimpleFillSymbolClass IPolygonpPolygon newPolygonClass IRubberBandpRubberBand newRubberPolygonClass ISimpleLineSymbolpSimpleLineSymbol newSimpleLineSymbolClass pPolygonElement newPolygonElementClass if e button 1 pPolygon IPolygon pRubberBand TrackNew axMapControl1 ActiveView ScreenDisplay null pSimpleLineSymbol Width 2 pSimpleLineSymbol Style esri
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年线下演出市场复苏与城市文旅产业融合发展报告
- 2025年工业互联网平台边缘计算硬件架构在人工智能领域的创新应用报告
- 2025年新媒体环境下新闻传播真实性评估与分析报告
- 2025年快时尚在时尚零售市场中的时尚跨界合作案例研究分析报告
- 私人雇佣送货合同范本
- 自家农田开垦合同范本
- 贴砖工具转让合同范本
- 活动物料公司合同范本
- 门面无偿出租合同范本
- 民间债券转让合同范本
- 机关事业单位驾驶员技师试卷(附答案)
- 2025年成考专升本政治时政练习题及答案
- 机械租赁服务方案
- 老年康复护理专项技术指南
- 消防设施故障应急处理预案
- 2025外汇展业知识竞赛真题模拟及答案
- 散装柴油管理制度
- 原发性高血压
- 退休教师国庆节活动方案
- CA6140普通车床进给系统的数控化改造
- 低效林改造管理办法
评论
0/150
提交评论