ArcGIS Pro SDK 汇总
框架
如何在停靠窗格可见或隐藏时订阅和取消订阅事件
1 | private SubscriptionToken _eventToken = null; |
执行命令
1 | IPlugInWrapper wrapper = FrameworkApplication.GetPlugInWrapper("esri_editing_ShowAttributes"); |
设置当前工具
1 | // use SetCurrentToolAsync |
激活选项卡
1 | FrameworkApplication.ActivateTab("esri_mapping_insertTab"); |
激活/停用状态 - 修改条件
1 | // Define the condition in the DAML file based on the state |
确定应用程序是否繁忙
1 | // The application is considered busy if a task is currently running on the main worker thread or any |
获取应用程序主窗口
1 | System.Windows.Window window = FrameworkApplication.Current.MainWindow; |
关闭 ArcGIS Pro
1 | FrameworkApplication.Close(); |
获取 ArcGIS 专业版
1 | //"GetEntryAssembly" should be ArcGISPro.exe |
关闭特定窗格
1 | string _viewPaneID = "my pane"; //DAML ID of your pane |
激活窗格
1 | var mapPanes = ProApp.Panes.OfType<IMapPane>(); |
获取有关当前安装的加载项的信息
1 | var addin_infos = FrameworkApplication.GetAddInInfos(); |
查找码头窗格
1 | // in order to find a dockpane you need to know it's DAML id |
码头窗格属性和方法
1 | // in order to find a dockpane you need to know it's DAML id |
码头窗格撤消/重做
1 | // in order to find a dockpane you need to know it's DAML id |
查找停靠窗格并获取其视图模型
1 | // in order to find a dockpane you need to know it's DAML id. |
打开“后台”选项卡
1 | //Opens the Backstage to the "About ArcGIS Pro" tab. |
访问当前主题
1 | //Gets the application's theme |
显示专业消息框
1 | ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show("Some Message", "Some title", MessageBoxButton.YesNo, MessageBoxImage.Information, MessageBoxResult.Yes); |
添加吐司通知
1 | Notification notification = new Notification(); |
更改按钮标题或图像
1 | private void ChangeCaptionImage() |
获取按钮的工具提示标题
1 | //Pass in the daml id of your button. Or pass in any Pro button ID. |
订阅活动工具更改事件
1 | private void SubscribeEvent() |
进度器 - 简单且不可取消
1 | public async Task Progressor_NonCancelable() |
进度器 - 可取消
1 | public async Task Progressor_Cancelable() |
自定义按钮或工具的 disabedText 属性
1 | //Set the tool's loadOnClick attribute to "false" in the config.daml. |
从当前程序集获取图像资源
1 | public static void ExampleUsage() |
阻止 ArcGIS Pro 关闭
1 | // There are two ways to prevent ArcGIS Pro from closing |
如何在 MapView 中定位可嵌入控件
1 | public ProSnippetMapTool() |
激活选项卡时命令搜索中建议的命令选项。
1 | //In the module class.. |
从命令行启动 ArcGIS Pro
1 | C:\>"C:\Program Files\ArcGIS Pro\bin\ArcGISPro.exe" |
获取命令行参数
如果您的外接程序需要使用自定义命令行参数,则参数的格式必须为“/argument” - 请注意正斜杠“/”。不能有空格。如果命令行包含要打开的项目(请参阅从命令行打开项目),则必须将自定义参数或开关放在项目文件名参数之前。
1 | string[] args = System.Environment.GetCommandLineArgs(); |
应用程序加速器(快捷键)
可以使用加速器/插入加速器 DAML 元素将应用程序加速器添加到外接程序 config.daml 中,该元素具有要与加速器关联的元素的 refID(即快捷方式)。
1 | <accelerators> |
注意:使用 updateModule 元素中的 deleteAccelerator 和 updateAccelerator DAML 元素分别删除或更改应用程序加速器。 标志可以是以下之一:Shift、Ctrl、Alt、Ctrl+Shift、Alt+Shift、Ctrl+Alt、Ctrl+Alt+Shift
使用专业样式在 DAML 中定义控件
定义了许多 ArcGIS Pro 样式,这些样式可应用于窗格和停靠窗格上的按钮、标注和其他控件,以使加载项的外观与 ArcGIS Pro 无缝衔接。下面列出了一些最常见的样式。有关更多样式和颜色,请参阅社区示例存储库中的使用 ArcGIS Pro 设置样式示例。
按钮样式
1 | <Button Content="Button" Style="{StaticResource Esri_SimpleButton}" ToolTip="Button"> |
码头窗格标题样式
1 | <TextBlock Text="MyDockPane" Style="{StaticResource DockPaneHeading}" |
内容
项目
创建一个空项目
1 | //Create an empty project. The project will be created in the default folder |
创建具有指定名称的新项目
1 | //Settings used to create a new project |
使用 Pro 的默认设置创建新项目
1 | //Get Pro's default project settings. |
使用自定义模板文件新建项目
1 | //Settings used to create a new project |
使用 ArcGIS Pro 提供的模板创建工程
1 | //Settings used to create a new project |
打开现有项目
1 | //Opens an existing project or project package |
获取当前项目
1 | //Gets the current project |
获取当前项目的位置
1 | //Gets the location of the current project; that is, the path to the current project file (*.aprx) |
获取项目的默认 gdb 路径
1 | var projGDBPath = Project.Current.DefaultGeodatabasePath; |
保存项目
1 | //Saves the project |
检查是否需要保存项目
1 | //The project's dirty state indicates changes made to the project have not yet been saved. |
另存为项目
1 | //Saves a copy of the current project file (*.aprx) to the specified location with the specified file name, |
关闭项目
1 | //A project cannot be closed using the ArcGIS Pro API. |
如何向工程添加新地图
1 | await QueuedTask.Run(() => |
项目项
将文件夹连接项添加到当前项目
1 | //Adding a folder connection |
获取所有项目项
1 | IEnumerable<Item> allProjectItems = Project.Current.GetItems<Item>(); |
获取项目的所有“MapProjectItems”
1 | IEnumerable<MapProjectItem> newMapItemsContainer = project.GetItems<MapProjectItem>(); |
获取特定的“MapProjectItem”
1 | MapProjectItem mapProjItem = Project.Current.GetItems<MapProjectItem>().FirstOrDefault(item => item.Name.Equals("EuropeMap")); |
获取所有“样式项目项”
1 | IEnumerable<StyleProjectItem> newStyleItemsContainer = null; |
获取特定的“样式项目项”
1 | var container = Project.Current.GetItems<StyleProjectItem>(); |
获取“收藏夹”样式项目项
1 | var fav_style_item = await QueuedTask.Run(() => |
获取所有“GDBProjectItems”
1 | IEnumerable<GDBProjectItem> newGDBItemsContainer = null; |
获取特定的“GDBProjectItem”
1 | GDBProjectItem GDBProjItem = Project.Current.GetItems<GDBProjectItem>().FirstOrDefault(item => item.Name.Equals("myGDB")); |
获取所有“服务器连接项目项”
1 | IEnumerable<ServerConnectionProjectItem> newServerConnections = null; |
获取特定的“服务器连接项目项”
1 | ServerConnectionProjectItem serverProjItem = Project.Current.GetItems<ServerConnectionProjectItem>().FirstOrDefault(item => item.Name.Equals("myServer")); |
获取项目中的所有文件夹连接
1 | //Gets all the folder connections in the current project |
获取特定文件夹连接
1 | //Gets a specific folder connection in the current project |
删除特定文件夹连接
1 | // Remove a folder connection from a project; the folder stored on the local disk or the network is not deleted |
获取特定的“布局项目项”
1 | LayoutProjectItem layoutProjItem = Project.Current.GetItems<LayoutProjectItem>().FirstOrDefault(item => item.Name.Equals("myLayout")); |
获取项目中的所有布局
1 | //Gets all the layouts in the current project |
获取特定的“地理处理项目项”
1 | GeoprocessingProjectItem GPProjItem = Project.Current.GetItems<GeoprocessingProjectItem>().FirstOrDefault(item => item.Name.Equals("myToolbox")); |
获取工程中的所有地理处理工程项
1 | //Gets all the GeoprocessingProjectItem in the current project |
在项目中搜索特定项目
1 | List<Item> _mxd = new List<Item>(); |
获取默认项目文件夹
1 | //Get Pro's default project settings. |
刷新文件夹连接项的子项
1 | var contentItem = Project.Current.GetItems<FolderConnectionProjectItem>().First(); |
获取项目类别
1 | // Get the ItemCategories with which an item is associated |
使用项目类别
1 | // Browse items using an ItemCategory as a filter |
使用模板创建项目
1 | var projectFolder = System.IO.Path.Combine( |
选择项目容器 - 用于 SelectItemAsync
1 | //Use Project.Current.ProjectItemContainers |
项目项:获取项或查找项
1 | //GetItems searches project content |
在目录窗格中选择一个项目
1 | //Get the catalog pane |
地理数据库内容
浏览对话框中的地理数据库内容
1 | var openDlg = new OpenItemDialog |
目录中的地理数据库内容
1 | // subscribe to event |
收藏 夹
添加收藏夹 - 文件夹
1 | var itemFolder = ItemFactory.Instance.Create(@"d:\data"); |
插入收藏夹 - 地理数据库路径
1 | string gdbPath = "@C:\\myDataFolder\\myData.gdb"; |
添加收藏夹 - 设置项目项的样式
1 | StyleProjectItem styleItem = Project.Current.GetItems<StyleProjectItem>(). |
切换标志是添加到所有新项目为收藏夹
1 | var itemFolder = ItemFactory.Instance.Create(@"d:\data"); |
获取收藏夹集并迭代
1 | var favorites = FavoritesManager.Current.GetFavorites(); |
删除所有收藏夹
1 | var favorites = FavoritesManager.Current.GetFavorites(); |
收藏夹更改事件
1 | ArcGIS.Desktop.Core.Events.FavoritesChangedEvent.Subscribe((args) => |
元数据
项目:获取其 IMetadata 接口
1 | Item gdbItem = ItemFactory.Instance.Create(@"C:\projectAlpha\GDBs\regionFive.gdb"); |
项目:获取项目的元数据:获取XML
1 | string gdbXMLMetadataXmlAsString = string.Empty; |
项目:设置项目的元数据:设置XML项
1 | await QueuedTask.Run(() => |
项目:检查元数据是否可以编辑:可以编辑
1 | bool canEdit1; |
项目:使用项目的当前属性更新元数据:同步
1 | string syncedMetadataXml = string.Empty; |
项目:从源项目的元数据复制元数据:复制元数据从项目
1 | Item featureClassItem = ItemFactory.Instance.Create(@"C:\projectAlpha\GDBs\regionFive.gdb\SourceFeatureClass"); |
项目:从当前项目的元数据中删除某些内容:删除元数据内容
1 | Item featureClassWithMetadataItem = ItemFactory.Instance.Create(@"C:\projectBeta\GDBs\regionFive.gdb\SourceFeatureClass"); |
项目:使用导入的元数据更新元数据 - 输入路径可以是包含元数据的项目的路径,也可以是 XML 文件的 URI:导入元数据
1 | // the input path can be the path to an item with metadata, or a URI to an XML file |
项目:使用导入的元数据更新元数据:导入元数据
1 | // the input path can be the path to an item with metadata, or a URI to an XML file |
项目:导出当前选定项目的元数据:导出元数据
1 | await QueuedTask.Run(() => metadataItemExport1.ExportMetadata(@"E:\Temp\OutputXML.xml", MDImportExportOption.esriCurrentMetadataStyle, MDExportRemovalOption.esriExportExactCopy)); |
项目:导出当前选定项目的元数据:导出元数据
1 | await QueuedTask.Run(() => metadataItemExport2.ExportMetadata(@"E:\Temp\OutputXML.xml", MDImportExportOption.esriCustomizedStyleSheet, MDExportRemovalOption.esriExportExactCopy, @"E:\StyleSheets\Export\MyExportStyleSheet.xslt")); |
项目:将当前项目的元数据另存为 XML:将元数据另存为 XML
1 | await QueuedTask.Run(() => metadataItemToSaveAsXML.SaveMetadataAsXML(@"E:\Temp\OutputXML.xml", MDSaveAsXMLOption.esriExactCopy)); |
项目:将当前项目的元数据另存为 HTML:将元数据另存为HTML
1 | await QueuedTask.Run(() => metadataItemToSaveAsHTML.SaveMetadataAsHTML(@"E:\Temp\OutputHTML.htm", MDSaveAsHTMLOption.esriCurrentMetadataStyle)); |
项目:使用自定义 XSLT 保存当前项目的元数据:保存元数据作为使用自定义 XSLT
1 | await QueuedTask.Run(() => metadataItemToSaveAsUsingCustomXSLT.SaveMetadataAsUsingCustomXSLT(@"E:\Data\Metadata\CustomXSLT.xsl", @"E:\Temp\OutputXMLCustom.xml")); |
项目:升级当前项目的元数据:升级元数据
1 | var fgdcItem = ItemFactory.Instance.Create(@"C:\projectAlpha\GDBs\testData.gdb"); |
项目单位
获取所有可用单位格式的完整列表
1 | //Must be on the QueuedTask.Run() |
获取当前项目的单位格式列表
1 | //Must be on the QueuedTask.Run() |
获取当前项目的特定单位格式列表
1 | //Must be on the QueuedTask.Run() |
获取当前项目的默认格式列表
1 | //Must be on the QueuedTask.Run() |
获取当前项目的特定默认单位格式
1 | //Must be on the QueuedTask.Run() |
为当前项目设置特定的单位格式列表
1 | //Must be on the QueuedTask.Run() |
设置项目单位格式的默认值
1 | //Must be on the QueuedTask.Run() |
更新项目的单位格式
1 | //UnitFormatType.Angular, UnitFormatType.Area, UnitFormatType.Distance, |
应用选项
获取常规选项
1 | var startMode = ApplicationOptions.GeneralOptions.StartupOption; |
将“常规选项”设置为使用自定义设置
1 | //Set the application to use a custom project, home folder, gdb, and toolbox |
设置常规选项以使用默认值
1 | //Default options can be set regardless of the value of the "companion" |
获取下载选项
1 | var staging = ApplicationOptions.DownloadOptions.StagingLocation; |
设置共享和发布的暂存位置
1 | ApplicationOptions.DownloadOptions.StagingLocation = @"D:\data\staging"; |
设置 PPKX 的下载选项
1 | //Options are mutually exclusive. |
设置解压缩的下载选项其他
1 | //UnpackOther settings control unpacking of anything _other than_ |
设置离线地图的下载选项
1 | //OfflineMaps settings control where map content that is taken |
核心主机
初始化核心主机
1 | using ArcGIS.Core.Data; |
编辑
编辑操作方法
编辑操作创建要素
1 | var createFeatures = new EditOperation(); |
使用当前模板创建要素
1 | var myTemplate = ArcGIS.Desktop.Editing.Templates.EditingTemplate.Current; |
从修改后的检查器创建要素
1 | var insp = new ArcGIS.Desktop.Editing.Attributes.Inspector(); |
从 CSV 文件创建要素
1 | //Run on MCT |
编辑操作 使用表模板在表中创建行
1 | var tableTemplate = standaloneTable.GetTemplates().FirstOrDefault(); |
编辑操作剪辑特征
1 | var clipFeatures = new EditOperation(); |
编辑操作切割要素
1 | var select = MapView.Active.SelectFeatures(clipPoly); |
编辑操作删除要素
1 | var deleteFeatures = new EditOperation(); |
编辑操作重复要素
1 | { |
编辑操作分解特征
1 | var explodeFeatures = new EditOperation(); |
编辑操作合并功能
1 | var mergeFeatures = new EditOperation(); |
编辑操作 修改单个特征
1 | var modifyFeature = new EditOperation(); |
编辑操作 修改多个要素
1 | //Search by attribute |
搜索图层要素并更新字段
1 | ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => |
移动要素
1 | //Get all of the selected ObjectIDs from the layer. |
将要素移动到特定坐标
1 | //Get all of the selected ObjectIDs from the layer. |
编辑操作平面化要素
1 | // note - EditOperation.Planarize requires a standard license. |
编辑操作并行偏移
1 | //Create parrallel features from the selected features |
编辑操作重塑特征
1 | var reshapeFeatures = new EditOperation(); |
编辑操作旋转要素
1 | var rotateFeatures = new EditOperation(); |
编辑操作比例要素
1 | var scaleFeatures = new EditOperation(); |
编辑操作拆分要素
1 | var splitFeatures = new EditOperation(); |
编辑操作变换特征
1 | var transformFeatures = new EditOperation(); |
编辑操作橡皮板功能
1 | //Perform rubbersheet by geometries |
编辑操作 执行剪辑、剪切和平坦化
1 | //Multiple operations can be performed by a single |
编辑操作链 编辑操作
1 | //Chaining operations is a special case. Use "Chained Operations" when you require multiple transactions |
编辑操作通过行令牌添加附件
1 | //ArcGIS Pro 2.5 extends the EditOperation.AddAttachment method to take a RowToken as a paramter. |
SetOnUndone, SetOnRedone, SetOnComitted
1 | // SetOnUndone, SetOnRedone and SetOnComittedManage can be used to manage |
启用编辑
启用编辑
1 | // if not editing |
禁用编辑
1 | // if editing |
地图拓扑
构建地图拓扑
1 | private async Task BuildGraphWithActiveView() |
行事件
订阅行事件
1 | protected void SubscribeRowEvent() |
在行事件中的映射中的单独表中创建记录
1 | // Use the EditOperation in the RowChangedEventArgs to append actions to be executed. |
在行事件中的单独表中创建记录
1 | // Use the EditOperation in the RowChangedEventArgs to append actions to be executed. |
修改行事件中的记录 - 使用 Row.Store
1 | private void HookRowChangedEvent() |
修改行事件中的记录 - 使用 EditOperation.Modify
1 | private void HookChangedEvent() |
确定编辑时几何图形是否更改
1 | private static FeatureLayer featureLayer; |
取消删除
1 | public static void StopADelete() |
编辑已完成事件
订阅编辑已完成事件
1 | protected void subEditEvents() |
检查员
将要素从图层加载到检查器中
1 | // get the first feature layer in the map |
将地图选择加载到检查器中
1 | // get the currently selected features in the map |
获取所选要素的属性值
1 | QueuedTask.Run(() => |
将地图选择加载到检查器并更改属性
1 | // get the currently selected features in the map |
使用检查器获取图层方案
1 | QueuedTask.Run(() => |
检查器.添加验证
1 | var insp = new Inspector(); |
访问 Blob 字段
使用属性检查器读取和写入 Blob 字段
1 | QueuedTask.Run(() => |
在回调中使用行游标读取和写入 Blob 字段
1 | QueuedTask.Run(() => |
访问栅格字段
从栅格字段读取
1 | QueuedTask.Run(() => |
将图像写入栅格字段
1 | QueuedTask.Run(() => |
将压缩图像写入栅格字段
1 | QueuedTask.Run(() => |
使用草图
切换草图选择模式
1 | //UseSelection = true; (UseSelection must be set to true in the tool constructor or tool activate) |
聆听草图修改事件
1 | // SketchModified event is fired by |
收听草图完成前事件并修改草图
1 | // BeforeSketchCompleted event is fired by |
收听草图完成事件
1 | // SketchCompleted event is fired by |
触发草图事件的自定义构造工具
1 | internal class ConstructionTool1 : MapTool |
自定义自定义草图工具的草图符号
1 | //Custom tools have the ability to change the symbology used when sketching a new feature. |
捕捉
配置捕捉 - 打开或关闭捕捉
1 | //enable snapping |
配置捕捉 - 应用程序捕捉模式
1 | // set only Point and Edge snapping modes, clear everything else |
配置捕捉 - 图层捕捉可捕捉性
1 | // is the layer snappable? |
配置捕捉 - 图层捕捉模式
1 | layerList = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>(); |
配置捕捉 - 组合示例
1 | // interested in only snapping to the vertices of a specific layer of interest and not the vertices of other layers |
捕捉选项
1 | //Set snapping options via get/set options |
撤消/重做
撤消/重做最近的操作
1 | //undo |
编辑模板
在图层上按名称查找编辑模板
1 | ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => |
查找属于独立表的表模板
1 | ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => |
当前模板
1 | EditingTemplate template = EditingTemplate.Current; |
更改模板的默认编辑工具
1 | public Task ChangeTemplateDefaultToolAsync(ArcGIS.Desktop.Mapping.FeatureLayer flayer, |
隐藏或显示模板上的编辑工具
1 | QueuedTask.Run(() => |
使用图层创建新模板。创建模板
1 | var layer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(); |
使用表创建新表模板。创建模板
1 | var table = MapView.Active.Map.GetStandaloneTablesAsFlattenedList().FirstOrDefault(); |
更新表模板
1 | QueuedTask.Run(() => |
创建注释模板
1 | // get an anno layer |
删除表模板
1 | var table = MapView.Active.Map.GetStandaloneTablesAsFlattenedList().FirstOrDefault(); |
活动模板已更改
1 | ArcGIS.Desktop.Editing.Events.ActiveTemplateChangedEvent.Subscribe(OnActiveTemplateChanged); |
注解
注释构建工具
1 | //In your config.daml...set the categoryRefID |
以编程方式启动编辑批注
1 | var plugin = FrameworkApplication.GetPlugInWrapper("esri_editing_EditVerticesText"); |
更新批注文本
1 | await QueuedTask.Run(() => |
修改批注形状
1 | await QueuedTask.Run(() => |
修改批注文本图形
1 | await QueuedTask.Run(() => |
ProSnippet 组 : 接地到网格
G2G 设置
1 | CIMGroundToGridCorrection correction = null; |
编辑选项
获取/设置编辑选项
1 | //toggle, switch option values |
获取草图折点符号系统选项
1 | var options = ApplicationOptions.EditingOptions; |
获取草图线段符号系统选项
1 | //var options = ApplicationOptions.EditingOptions; |
设置草图顶点符号选项
1 | //var options = ApplicationOptions.EditingOptions; |
设置草图线段符号选项
1 | //var options = ApplicationOptions.EditingOptions; |
将草图顶点符号设置回默认值
1 | //var options = ApplicationOptions.EditingOptions; |
将草图线段符号设置回默认值
1 | //var options = ApplicationOptions.EditingOptions; |
版本控制选项
获取和设置版本控制选项
1 | var vOptions = ApplicationOptions.VersioningOptions; |
创建注记构造工具
通过属性更新批注文本。警告:TEXTSTRING Anno 属性必须存在
旋转或移动批注
更改批注文本图形
公共设施网络
创建公共设施网络关联
在单个编辑操作中创建公共设施网络要素和关联
地理数据库
地理数据库和数据存储
打开给定路径的文件地理数据库
1 | public async Task OpenFileGDB() |
使用连接属性打开企业级地理数据库
1 | public async Task OpenEnterpriseGeodatabase() |
使用 sde 文件路径打开企业级地理数据库
1 | public async Task OpenEnterpriseGeodatabaseUsingSDEFilePath() |
从工程项获取地理数据库
1 | public async Task ObtainingGeodatabaseFromProjectItem() |
从连接文件获取数据库连接属性
1 | DatabaseConnectionFile connectionFile = new DatabaseConnectionFile(new Uri("path\\to\\sde\\file\\sdefile.sde")); |
从要素图层获取地理数据库
1 | public async Task ObtainingGeodatabaseFromFeatureLayer() |
执行 SQL 语句
1 | // Executes raw SQL on the underlying database management system. |
定义
从地理数据库获取定义
1 | public async Task ObtainingDefinitionFromGeodatabase() |
从地理数据库获取定义列表
1 | public async Task ObtainingDefinitionsFromGeodatabase() |
从地理数据库获取相关定义
1 | public async Task ObtainingRelatedDefinitionsFromGeodatabase() |
从层获取表定义
1 | // GetDefinitionFromLayer - This code works even if the layer has a join to another table |
数据
从地理数据库打开数据集
1 | public async Task OpeningDatasetsFromGeodatabase() |
检查表是否存在
1 | // Must be called within QueuedTask.Run9) |
检查要素类是否存在
1 | // Must be called within QueuedTask.Run() |
打开关系两个表之间的类
1 | // Must be called within QueuedTask.Run(). |
从关系类获取相关要素类
1 | public async Task GetFeatureClassesInRelationshipClassAsync() |
从 shapefile 数据存储打开要素类
1 | public async Task OpenShapefileFeatureClass() |
打开 CAD 数据存储
1 | public async Task OpenCADFeatureClass() |
查询
使用查询筛选器搜索表
1 | public async Task SearchingATable() |
在表中搜索非拉丁字符
1 | using (Geodatabase geodatabase = new Geodatabase(new DatabaseConnectionFile(new Uri("path\\to\\sde\\file\\sdefile.sde")))) |
使用一组对象 ID 搜索表
1 | public RowCursor SearchingATable(Table table, IReadOnlyList<long> objectIDs) |
使用空间查询过滤器搜索要素类
1 | public async Task SearchingAFeatureClass() |
从表中选择行
1 | public async Task SelectingRowsFromATable() |
从要素类中选择要素
1 | public async Task SelectingFeaturesFromAFeatureClass() |
获取表中当前有多少行的计数
1 | //Note: call within QueuedTask.Run() |
获取图层的特征计数
1 | var lyr = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(); |
对表进行排序
1 | public RowCursor SortWorldCities(FeatureClass worldCitiesTable) |
计算表的统计信息
1 | // Calculate the Sum and Average of the Population_1990 and Population_2000 fields, grouped and ordered by Region |
在单个表上评估 QueryDef
1 | public async Task SimpleQueryDef() |
使用 WHERE 子句计算连接上的 QueryDef
1 | public async Task JoiningWithWhereQueryDef() |
在外部连接上计算 QueryDef
1 | public async Task EvaluatingQueryDefWithOuterJoin() |
在内部连接上评估 QueryDef
1 | public async Task EvaluatingQueryDefWithInnerJoin() |
在嵌套 - INNER 和 OUTER 连接上评估 QueryDef
1 | public async Task EvaluatingQueryDefWithNestedJoin() |
为数据库表创建默认查询描述并获取查询描述的 ArcGIS.Core.Data.Table
1 | public async Task DefaultQueryDescription() |
从数据库表的自定义查询创建查询说明
1 | public async Task CustomQueryDescription() |
从没有不可为空的唯一 id 列的联接查询创建查询说明
1 | public async Task JoinQueryDescription() |
从具有多个形状类型的数据库表的查询创建查询说明
1 | public async Task MultiGeometryQueryDescription() |
从 SQLite 数据库表的查询创建查询说明
1 | public async Task SqliteQueryDescription() |
使用 SQLSyntax 形成与平台无关的查询
1 | public async Task UsingSqlSyntaxToFormPlatformAgnosticQueries() |
将文件地理数据库要素类连接到具有虚拟关系类的 Oracle 数据库查询图层要素类
1 | public async Task JoiningFileGeodatabaseFeatureClassToOracleQueryLayer() |
连接来自不同地理数据库的两个表
1 | public async Task JoinTablesFromDifferentGeodatabases() |
使用在地理数据库中连接两个版本化表的查询创建查询表
1 | public async Task QueryTableJoinWithVersionedData() |
检查字段值是否为空
1 | var val = row[field.Name]; |
从字段中获取域字符串
1 | public string GetDomainStringFromField(Row row, Field field) |
编辑
创建行
1 | public async Task CreatingARow() |
创建特征
1 | public async Task CreatingAFeature() |
修改行
1 | public async Task ModifyingARow() |
修改特征
1 | public async Task ModifyingAFeature() |
将值写入 Guid 列
1 | row[field.Name] = "{" + guid.ToString() + "}"; |
删除行/要素
1 | public async Task DeletingARowOrFeature() |
添加附件
1 | public async Task AddingAttachments() |
更新附件
1 | public async Task UpdatingAttachments() |
删除附件
1 | public async Task DeletingAttachments() |
写入 Blob 字段
1 | public async Task WriteBlobField(Table table, string blobFieldName, string imageFileName) |
读取 Blob 字段
1 | public async Task ReadBlobField(Table table, QueryFilter queryFilter, string blobFieldName) |
获取按关系类关联的行
1 | public async Task GettingRowsRelatedByRelationshipClass() |
创建关系
1 | public async Task CreatingARelationship() |
删除关系
1 | public async Task DeletingARelationship() |
使用插入游标
1 | // Insert Cursors are intended for use in CoreHost applications, not Pro Add-ins |
使用 RowBuffer 在注记要素类中创建新的注记要素
1 | public async Task CreatingAnAnnotationFeature(Geodatabase geodatabase) |
版本控制
连接到版本
1 | public Geodatabase ConnectToVersion(Geodatabase geodatabase, string versionName) |
在单独的编辑会话中协调版本并将其与其父级进行核对和提交
1 | public void ReconcileAndPost(Geodatabase geodatabase) |
在同一编辑会话中协调版本并将其与其父级提交
1 | public void ReconcileAndPost2(Geodatabase geodatabase) |
使用版本
1 | public async Task WorkingWithVersions() |
使用默认版本
1 | // Check to see if the current version is default. |
创建版本
1 | public Version CreateVersion(Geodatabase geodatabase, string versionName, string description, VersionAccessType versionAccessType) |
创建历史版本
1 | public HistoricalVersion CreateHistoricalVersion(Geodatabase geodatabase, string versionName) |
在版本之间切换
1 | public void ChangeVersions(Geodatabase geodatabase, string toVersionName) |
部分过账
1 | // Partial posting allows developers to post a subset of changes made in a version. |
DDL
创建表
1 | // Create a PoleInspection table with the following fields |
创建要素类
1 | // Create a Cities feature class with the following fields |
删除表
1 | // Create a TableDescription object |
删除要素类
1 | // Create a FeatureClassDescription object |
打开内存地理数据库
1 | // Connects to the default memory geodatabase, if exists otherwise throws exception |
创建内存地理数据库
1 | // Create the memory connection properties to connect to default memory geodatabase |
删除内存地理数据库
1 | // Create the memory connection properties to connect to default memory geodatabase |
创建文件地理数据库
1 | // Create a FileGeodatabaseConnectionPath with the name of the file geodatabase you wish to create |
删除文件地理数据库
1 | // Create a FileGeodatabaseConnectionPath with the name of the file geodatabase you wish to delete |
创建移动地理数据库
1 | // Create a MobileGeodatabaseConnectionPath with the name of the mobile geodatabase you wish to create |
删除移动地理数据库
1 | // Create a MobileGeodatabaseConnectionPath with the name of the mobile geodatabase you wish to delete |
创建范围域
1 | // Create a range description with minimum value = 0 and maximum value = 1000 |
创建编码值域
1 | // Create a CodedValueDomain description for water pipes |
创建要素数据集
1 | // Creating a FeatureDataset named as 'Parcel_Information' |
删除要素数据集
1 | // Deleting a FeatureDataset named as 'Parcel_Information' |
重命名要素数据集
1 | // Renaming a FeatureDataset from 'Parcel_Information' to 'Parcel_Information_With_Tax_Jurisdiction' |
在一次操作中创建具有要素类的要素数据集
1 | // Creating a FeatureDataset named as 'Parcel_Information' and a FeatureClass with name 'Parcels' in one operation |
在现有要素数据集中创建要素类
1 | // Creating a FeatureClass named as 'Tax_Jurisdiction' in existing FeatureDataset with name 'Parcels_Information' |
将要素类添加到要素数据集
1 | // Adding a FeatureClass with name 'Tax_Jurisdiction' into a FeatureDataset named as 'Parcels_Information' |
重命名表
1 | //Renaming a table from 'Original_Table' to 'Renamed_Table' |
向要素类添加字段
1 | // Adding following fields to the 'Parcels' FeatureClass |
添加使用域的字段
1 | // Adding a field,'PipeType', which uses the coded value domain to the 'Pipes' FeatureClass |
从表中删除字段
1 | // Removing all fields from 'Parcels' table except following |
创建注记要素类
1 | // Creating a Cities annotation feature class |
创建关联要素的注记要素类
1 | // Creating a feature-linked annotation feature class between water pipe and valve in water distribution network |
在要素数据集内创建注记要素类
1 | // Create a Cities annotation feature class inside Places feature dataset using existing annotation feature class |
地理数据库拓扑代码段
开放拓扑和进程定义
1 | public void OpenTopologyAndProcessDefinition() |
获取拓扑规则
1 | using (TopologyDefinition topologyDefinition = topology.GetDefinition()) |
验证拓扑
1 | public void ValidateTopology() |
获取拓扑错误
1 | // Get all the errors and exceptions currently associated with the topology. |
MarkAndUnmarkAsErrors
1 | // Get all the errors due to features violating the "PointProperlyInsideArea" topology rule. |
探索拓扑图
1 | public void ExploreTopologyGraph() |
FindClosestElement
1 | public void FindClosestElement() |
几何
空间参考
构造空间参考 - 从已知 ID
1 | // Use a builder convenience method or use a builder constructor. |
构造空间引用 - 从字符串
1 | // Use a builder convenience method or use a builder constructor. |
使用 WGS84 空间参考
1 | SpatialReference wgs84 = SpatialReferences.WGS84; |
使用垂直坐标系构造空间参考 - 从已知 ID
1 | // Use a builder convenience method or use a builder constructor. |
使用垂直坐标系构造空间参考 - 从字符串
1 | // Use a builder convenience method or use a builder constructor. |
使用自定义 PCS 构造空间参考 - 从字符串
1 | // Use a builder convenience method or use a builder constructor. |
空间参考属性
1 | // Builder constructors need to run on the MCT. |
导入和导出空间参考
1 | SpatialReference srWithVertical = SpatialReferenceBuilder.CreateSpatialReference(4326, 6916); |
确定给定点处空间参考的格网收敛
1 | Coordinate2D coordinate = new Coordinate2D(10, 30); |
基准
1 | var cimMapDefinition = MapView.Active.Map.GetDefinition(); |
空间参照基准和基准属性
1 | // Get datum of a spatial reference |
坐标3D
矢量极坐标
1 | Coordinate3D polarVector = new Coordinate3D(0, 7, 0); |
获取矢量倾角
1 | Coordinate3D v = new Coordinate3D(0, 0, 7); |
获取矢量方位角
1 | Coordinate3D vector = new Coordinate3D(0, 7, 0); |
向量运算
1 | // Easy 3D vectors |
2D 矢量操作
1 | Coordinate2D v = new Coordinate2D(0, 1); |
生成器属性
生成器属性
1 | // list of points |
地图点
构造地图点
1 | // Use a builder convenience method or use a builder constructor. |
地图点生成器属性
1 | // Use a builderEx convenience method or a builderEx constructor. |
地图点是平等的
1 | MapPoint pt1 = MapPointBuilderEx.CreateMapPoint(1, 2, 3, 4, 5); |
缩放至指定点
1 | //Create a point |
折线
构造折线 - 从映射点的枚举
1 | // Use a builderEx convenience method or a builderEx constructor. |
获取折线的点
1 | // get the points as a readonly Collection |
获取折线的各个部分
1 | int numParts = polyline.PartCount; |
枚举折线的各个部分
1 | ReadOnlyPartCollection polylineParts = polyline.Parts; |
反转折线中点的顺序
1 | var polylineBuilder = new PolylineBuilderEx(polyline); |
获取折线的段
1 | ICollection<Segment> collection = new List<Segment>(); |
构建多部分折线
1 | List<MapPoint> firstPoints = new List<MapPoint>(); |
折线的起点
1 | // Method 1: Get the start point of the polyline by converting the polyline |
按角度构造布料
1 | MapPoint startPoint = MapPointBuilderEx.CreateMapPoint(0, 0); |
按长度构造布料
1 | MapPoint startPoint = MapPointBuilderEx.CreateMapPoint(0, 0); |
远距离分割折线
1 | // create list of points |
多边形
构造多边形 - 从映射点的枚举
1 | // Use a builderEx convenience method or use a builderEx constructor. |
构造多边形 - 从信封
1 | // Use a builderEx convenience method or use a builderEx constructor. |
获取多边形的点
1 | // get the points as a readonly Collection |
获取多边形的各个部分
1 | // get the parts as a readonly collection |
枚举多边形的各个部分
1 | int numSegments = 0; |
获取多边形的线段
1 | List<Segment> segmentList = new List<Segment>(30); |
构建圆环多边形
1 | List<Coordinate2D> outerCoordinates = new List<Coordinate2D>(); |
创建 N 侧正多边形
1 | // <summary> |
获取多边形的外环 - 多边形。获取外部环
1 | public void GetExteriorRings(Polygon inputPolygon) |
信封
构造封套
1 | // Use a builderEx convenience method or use a builderEx constructor. |
构造信封 - 从 JSON 字符串
1 | string jsonString = "{ \"xmin\" : 1, \"ymin\" : 2,\"xmax\":3,\"ymax\":4,\"spatialReference\":{\"wkid\":4326}}"; |
合并两个信封
1 | // use the convenience builders |
与两个信封相交
1 | // use the convenience builders |
展开信封
1 | // Use a builderEx convenience method or use a builderEx constructor. |
更新封套的坐标
1 | Coordinate2D minCoord = new Coordinate2D(1, 3); |
多点
构造多点 - 从映射点的枚举
1 | // Use a builderEx convenience method or use a builderEx constructor. |
构造多点 - 使用 MultipointBuilderEx
1 | Coordinate2D[] coordinate2Ds = new Coordinate2D[] { new Coordinate2D(1, 2), new Coordinate2D(-1, -2) }; |
修改多点的点
1 | // assume a multiPoint has been built from 4 points |
从多点检索点、2D 坐标、3D 坐标
1 | ReadOnlyPointCollection points = multipoint.Points; |
线段
使用两个地图点构造线段
1 | // Use a builderEx convenience method or use a builderEx constructor. |
更改线段坐标
1 | // builderEx constructors don't need to run on the MCT |
立方贝塞尔
构建三次方贝塞尔 - 从坐标
1 | // Use a builderEx convenience method or a builderEx constructor. |
构建立方贝塞尔 - 从地图点
1 | // Use a builderEx convenience method or a builderEx constructor. |
构造三次贝塞尔 - 从映射点的枚举
1 | // Use a buildeExr convenience method or use a builderEx constructor. |
立方贝塞尔生成器属性
1 | // retrieve the bezier curve's control points |
立方贝塞尔属性
1 | // retrieve the bezier curve's control points |
构造折线 - 从三次贝塞尔
1 | Polyline polyline = PolylineBuilderEx.CreatePolyline(bezierSegment); |
弧
构造圆弧 - 使用内部点
1 | // Construct a circular arc from (2, 1) to (1, 2) with interior pt (1 + sqrt(2)/2, 1 + sqrt(2)/2). |
构造圆弧 - 使用弦长度和方位
1 | // Construct a circular arc counterclockwise from (2, 1) to (1, 2) such that the embedded |
构建圆弧 - 使用中心点、角度和半径
1 | // Construct a circular arc with center point at (0, 0), from angle = 0, |
构造椭圆弧 - 使用中心点和旋转角度
1 | // Construct an elliptic arc centered at (1,1), startAngle = 0, centralAngle = PI/2, |
构造圆弧 - 使用中心点和方向
1 | // Construct a circular arc from (2, 1) to (1, 2) |
构造圆弧 - 使用两个线段和半径
1 | // Construct a segment from (100, 100) to (50, 50) and another segment from (100, 100) to (150, 50). |
构造一个圆
1 | // Construct a circle with center at (-1,-1), radius = 2, and oriented clockwise. |
构造椭圆
1 | // Construct an ellipse centered at (1, 2) with rotationAngle = -pi/6, |
Elliptic Arc Builder Properties
1 | // retrieve the curve's properties |
椭圆弧属性
1 | // retrieve the curve's control points |
几何袋
构造几何包
1 | MapPoint point = MapPointBuilderEx.CreateMapPoint(1, 2, SpatialReferences.WebMercator); |
构造几何包 - 从几何枚举
1 | // Use a builder convenience method or use a builder constructor. |
ConstructingGeometryBag - 来自 JSON、Xml
1 | const string jsonString = "{\"geometries\":[{\"x\":1,\"y\":2},{\"rings\":[[[0,0],[0,4],[3,4],[3,0],[0,0]]]}],\"spatialReference\":{\"wkid\":4326,\"latestWkid\":4326}}"; |
构造几何包 - 添加或插入几何枚举
1 | MapPoint point = MapPointBuilderEx.CreateMapPoint(10, 20); |
多面体
通过拉伸多边形或折线构建多面体
1 | // build a polygon |
多面体属性
1 | // standard geometry properties |
构建多面体
1 | // export to binary xml |
通过MultipatchBuilderEx构建多面体
1 | var coords_face1 = new List<Coordinate3D>() |
从另一个多面体构建多面体
1 | // create the multipatchBuilderEx object |
从 3D 模型文件构建多面体
1 | try |
构建 3D 特殊多面体形状
1 | var sr = MapView.Active.Map.SpatialReference; |
创建基本材料
1 | // Create BasicMaterial with default values |
使用 JPEG 纹理创建基本材质
1 | // read the jpeg into a buffer |
使用未压缩纹理创建基本材质
1 | UncompressedTexture uncompressedTexture1 = new UncompressedTexture(new byte[10 * 12 * 3], 10, 12, 3); |
获取多面体的纹理图像
1 | // <summary> |
获取多面体的法线坐标
1 | // <summary> |
获取多面体的法线
1 | // <summary> |
获取多面体的材质属性
1 | public void GetMaterialProperties(Multipatch multipatch, int patchIndex) |
多部件
获取多部分要素的各个部分
1 | public IEnumerable<Geometry> MultipartToSinglePart(Geometry inputGeometry) |
获取多边形的最外层环
1 | public Polygon GetOutermostRings(Polygon inputPolygon) |
从地理数据库检索几何
从地理数据库检索几何
1 | // methods need to run on the MCT |
导入、导出几何图形
将几何图形导入和导出为已知文本
1 | // create a point with z, m |
将几何图形导入和导出到众所周知的二进制
1 | // create a polyline |
将几何导入和导出到 EsriShape
1 | // create an envelope |
将几何图形导入和导出为 JSON
1 | // MapPoint |
将几何图形导入和导出为 XML
1 | MapPoint minPoint = MapPointBuilderEx.CreateMapPoint(1, 1, 1, 1, 3); |
转换
创建地理转换
1 | // create from wkid |
创建复合地理变换
1 | // Create singleton from wkid |
创建投影转换
1 | // methods need to be on the MCT |
创建高压基准变换
1 | // Create from wkid |
创建复合高压基准变换
1 | HVDatumTransformation hv1 = HVDatumTransformation.Create(108034); |
确定转换
1 | // methods need to run on the MCT |
地图点地理坐标字符串
地图点 - 地理坐标字符串转换
1 | SpatialReference sr = SpatialReferences.WGS84; |
角度单元
角度单位 - 在度和弧度之间转换
1 | // convert 45 degrees to radians |
角度单位 - 使用工厂代码创建角度单位
1 | try |
角度单位 - 创建自定义角度单位
1 | // custom unit - 3 radians per unit |
线性单位
线性单位 - 在英尺和米之间转换
1 | // convert 10 feet to meters |
线性单位 - 在厘米和毫米之间转换
1 | // convert 11 centimeters to millimeters |
线性单位 - 使用工厂代码创建线性单位
1 | try |
线性单位 - 创建自定义线性单位
1 | // create a custom linear unit - there are 0.33 meters per myLinearUnit |
面积单位
面积单位 - 在平方英尺和平方米之间转换
1 | // convert 700 square meters to square feet |
面积单位 - 在公顷和英亩之间转换
1 | // convert 2 hectares to acres |
面积单位 - 在公顷和平方英里之间转换
1 | // convert 300 hectares to square miles |
面积单位 - 各种单位的平方米数
1 | double sqMetersPerUnit = AreaUnit.Acres.SquareMetersPerUnit; |
面积单位 - 创建面积单位
1 | try |
几何引擎函数
加速几何图形
1 | // Use acceleration to speed up relational operations. Accelerate your source geometry only if you are going to test many other geometries against it. |
确定面的面积
1 | var g1 = PolygonBuilderEx.FromJson("{\"rings\": [ [ [0, 0], [10, 0], [10, 10], [0, 10] ] ] }"); |
确定多部分多边形的边界
1 | // create a donut polygon. Must use the PolygonBuilderEx object |
缓冲地图点
1 | // buffer a point |
缓冲圆弧
1 | // create the circular arc |
缓冲多个地图点
1 | // creates a buffer around each MapPoint |
缓冲多种不同的几何类型
1 | List<Coordinate2D> coords = new List<Coordinate2D>() |
在折线上插值 Z 值
1 | List<Coordinate3D> coords2 = new List<Coordinate3D>() |
在多边形上插值 M 值
1 | List<MapPoint> coords = new List<MapPoint>() |
将封套在 X,Y 周围居中
1 | Envelope env = EnvelopeBuilderEx.CreateEnvelope(1.0, 1.0, 5.0, 5.0); |
查找几何体的质心
1 | // simple polygon |
剪裁折线
1 | // clip a polyline by an envelope |
按多边形裁剪折线
1 | // clip a polyline by a polygon |
构建具有指定距离和方位角的大地测量线
1 | var sr = SpatialReferenceBuilder.CreateSpatialReference(4326); |
构建连接点的大地测量线
1 | var sr = SpatialReferenceBuilder.CreateSpatialReference(4326); |
在距现有点一定距离和一定角度处构造点
1 | MapPoint inPoint = MapPointBuilderEx.CreateMapPoint(3, 4); |
从一组折线构造多边形
1 | List<Coordinate2D> firstLinePts = new List<Coordinate2D>(); |
多边形包含地图点、折线、多边形
1 | // build a polygon |
确定凸包
1 | // |
确定两个几何图形是否相交
1 | // |
使用折线切割几何图形
1 | SpatialReference sr = SpatialReferences.WGS84; |
按长度致密
1 | // densify a line segment |
两个多边形之间的差异
1 | List<MapPoint> polyPts = new List<MapPoint>(); |
确定两个几何是否不相交
1 | // |
确定两个几何之间的距离
1 | MapPoint pt1 = MapPointBuilderEx.CreateMapPoint(1.0, 1.0); |
确定两个几何体之间的 3D 距离
1 | // between points |
展开信封
1 | Envelope env = EnvelopeBuilderEx.CreateEnvelope(100.0, 100.0, 500.0, 500.0); |
扩展折线
1 | // build a polyline |
概括
1 | Polyline generalizedPolyline = GeometryEngine.Instance.Generalize(polylineWithZ, 200) as Polyline; |
计算面的测地线面积
1 | var polygon = PolygonBuilderEx.CreatePolygon(new[] |
在指定的测地线距离处创建缓冲区面
1 | // buffer a point |
确定两个几何之间的测地线距离
1 | var point1 = MapPointBuilderEx.CreateMapPoint(-170, 45, SpatialReferences.WGS84); |
测地线椭圆
1 | GeodesicEllipseParameter param = new GeodesicEllipseParameter(); |
确定线的测地线长度
1 | var polyline = PolylineBuilderEx.CreatePolyline(new[] |
测地线扇区
1 | GeodesicSectorParameter param = new GeodesicSectorParameter(); |
大地测量致密化偏差 - 折线
1 | List<Coordinate2D> coords = new List<Coordinate2D>() |
大地测量致密按长度 - 多边形
1 | List<Coordinate2D> coords = new List<Coordinate2D>() |
计算大地测量距离,两点之间的方位角
1 | SpatialReference sr = SpatialReferences.WGS84; |
对一组地图点执行大地测量移动
1 | SpatialReference sr = SpatialReferences.WebMercator; |
检索坐标系
1 | // get all the geographic coordinate systems |
检索系统地理变换
1 | // a geographic transformation is the definition of how to project from one spatial reference to another |
获取折线或多边形的子曲线
1 | SpatialReference sr = SpatialReferences.WGS84; |
图形缓冲区
1 | // mitered join and butt caps |
图形缓冲器很多
1 | // round join and round caps |
两条折线之间的交点
1 | // determine intersection between two polylines |
两个多边形之间的交点
1 | // determine intersection between two polygons |
确定多边形的标注点
1 | // create a polygon |
确定线的长度,长度3D
1 | MapPoint c1 = MapPointBuilderEx.CreateMapPoint(1, 2, 3); |
获取最小和最大 M 值 - GetMinMaxM
1 | string json = "{\"hasM\":true,\"rings\":[[[-3000,-2000,10],[-2000,-2000,15],[-1000,-2000,20],[0,-2000,0],[1000,-2000,-20],[2000,-2000,-30],[3000,-2000,10],[4000,-2000,5]]],\"spatialReference\":{\"wkid\":3857}}"; |
确定 M 是单调的,是升序还是降序 - GetMMonotonic
1 | string json = "{\"hasM\":true,\"paths\":[[[-3000,-2000,10],[-2000,-2000,15],[-1000,-2000,20]]]}"; |
获取与几何图形中指定 M 值出现的位置相对应的多点 - GetPointsAtM
1 | string json = "{\"hasM\":true,\"paths\":[[[-3000,-2000,10],[-2000,-2000,15],[-1000,-2000,20],[0,-2000,0],[1000,-2000,20],[2000,-2000,30],[3000,-2000,10],[4000,-2000,5]]],\"spatialReference\":{\"wkid\":3857}}"; |
获取与指定 M 值之间的子曲线对应的折线 - GetSubCurveBetweenMs
1 | string json = "{\"hasM\":true,\"paths\":[[[-2000,0,1],[-1000,1000,2],[-1000,0,3],[1000,1000,4],[2000,1000,5],[2000,2000,6],[3000,2000,7],[4000,0,8]]],\"spatialReference\":{\"wkid\":3857}}"; |
获取与沿几何图形中出现指定 M 值的位置处的法线对应的线段 - GetNormalsAtM
1 | IList<MapPoint> inPoints = new List<MapPoint>() |
获取沿多部分的指定距离处的 M 值
1 | string json = "{\"hasM\":true,\"paths\":[[[-3000,-2000,-3],[-2000,-2000,-2]],[[-2000,-2000,1],[-2000,1000,2]]],\"spatialReference\":{\"wkid\":3857}}"; |
将 M 值设置为从多部分开始的累积长度 - SetMsAsDistance
1 | string json = "{\"hasM\":true,\"rings\":[[[0,0],[0,3000],[4000,3000],[4000,0],[0,0]]],\"spatialReference\":{\"wkid\":3857}}"; |
在给定距离处插入 M 值 - 插入距离
1 | string json = "{\"hasM\":true,\"paths\":[[[-3000,-2000,-3],[-2000,-2000,-2],[-1000,-2000,null]]]}"; |
使用输入点的 M 值校准 M 值 - CalibrateByMs
1 | string json = "{\"hasM\":true,\"paths\":[[[0,0,-1],[1,0,0],[1,1,1],[1,2,2],[3,1,3],[5,3,4],[9,5,5],[7,6,6]]],\"spatialReference\":{\"wkid\":4326}}"; |
通过对一系列点进行线性插值生成 M 值 - 插值MsBetween
1 | string json = "{\"hasM\":true,\"paths\":[[[0,0,-1],[1,0,0],[1,1,1],[1,2,2],[3,1,3],[5,3,4],[9,5,5],[7,6,6]]],\"spatialReference\":{\"wkid\":4326}}"; |
在几何图形的开头和结尾设置 Ms,并在两个值之间插值 M 值 - SetAndIntervalateMsBetween
1 | string json = "{\"hasM\":true,\"paths\":[[[-3000,-2000],[-2000,-2000],[-1000,-2000],[0,-2000],[1000,-2000],[2000,-2000],[3000,-2000],[4000,-2000]]],\"spatialReference\":{\"wkid\":3857}}"; |
移动地图点
1 | MapPoint pt = MapPointBuilderEx.CreateMapPoint(1.0, 3.0); |
移动 z 感知地图点
1 | MapPoint zPt = MapPointBuilderEx.CreateMapPoint(1.0, 3.0, 2.0); |
移动折线
1 | List<MapPoint> pts = new List<MapPoint>(); |
移动点沿线
1 | LineSegment line = LineBuilderEx.CreateLineSegment(MapPointBuilderEx.CreateMapPoint(0, 3), MapPointBuilderEx.CreateMapPoint(5.0, 3.0)); |
将几何体的组件分离为单个组件几何图形
1 | List<Coordinate2D> coords2D = new List<Coordinate2D>() |
最近点与最近顶点
1 | SpatialReference sr = SpatialReferences.WGS84; |
确定 3D 中的最近点
1 | MapPoint pt1 = MapPointBuilderEx.CreateMapPoint(1, 1, 1); |
计算与源的几何偏移
1 | List<MapPoint> linePts = new List<MapPoint>(); |
确定几何图形是否重叠
1 | MapPoint pt1 = MapPointBuilderEx.CreateMapPoint(1.5, 1.5); |
从 WGS84 到 Web墨卡托的项目
1 | MapPoint pt = MapPointBuilderEx.CreateMapPoint(1.0, 3.0, SpatialReferences.WGS84); |
WGS84的项目
1 | // create the polygon |
查询正常
1 | string json = "{\"curvePaths\":[[[-13046586.8335,4036570.6796000004]," + |
查询点
1 | SpatialReference sr = SpatialReferences.WGS84; |
查询点和距离
1 | // Horizontal line segment |
查询切线
1 | LineSegment line = LineBuilderEx.CreateLineSegment(new Coordinate2D(0, 0), new Coordinate2D(1, 0)); |
围绕线反射多边形
1 | SpatialReference sr = SpatialReferences.WGS84; |
确定两个几何图形之间的关系
1 | // set up some geometries |
替换多边形中的 NaN Z
1 | List<Coordinate3D> coordsZ = new List<Coordinate3D>() |
改变多边形的形状
1 | List<Coordinate2D> polygon1Coords = new List<Coordinate2D>() |
反转多边形中点的顺序
1 | List<Coordinate2D> list2D = new List<Coordinate2D>(); |
旋转地图点
1 | MapPoint pt = MapPointBuilderEx.CreateMapPoint(1.0, 3.0); |
旋转折线
1 | // rotate a polyline |
缩放几何图形
1 | List<MapPoint> pts = new List<MapPoint>(); |
设置折线中的所有 Z
1 | List<Coordinate3D> coordsZ = new List<Coordinate3D>() |
计算地球椭球体表面上的几何面积 - 形状保存面积
1 | // pt |
计算地球椭球体表面几何形状的长度 - 形状保存长度
1 | // pt |
侧缓冲器
1 | // right side, round caps |
侧缓冲器很多
1 | SpatialReference spatialReference = SpatialReferenceBuilder.CreateSpatialReference(102010); |
简化多边形
1 | var g1 = PolygonBuilderEx.FromJson("{\"rings\": [ [ [0, 0], [10, 0], [10, 10], [0, 10] ] ] }"); |
简化具有相交、重叠的折线
1 | List<Coordinate2D> coords = new List<Coordinate2D>() |
将多边形切成相等的部分
1 | var slices = GeometryEngine.Instance.SlicePolygonIntoEqualParts(polygon, 3, 0, SliceType.Blocks); |
在点拆分多部分
1 | // define a polyline |
多边形接触另一个多边形
1 | // two disjoint polygons |
转换2D
1 | // Not all of the input points are transformed as some of them are outside of the GCS horizon. |
转换3D
1 | // Not all of the input points are transformed as some of them are outside of the GCS horizon. |
合并两个地图点 - 创建一个多点
1 | MapPoint pt1 = MapPointBuilderEx.CreateMapPoint(1.0, 1.0); |
并集两个多边形
1 | // union two polygons |
联合许多折线
1 | // union many polylines |
联合多个多边形
1 | // union many polygons |
地图点、折线、多边形内的多边形
1 | // build a polygon |
地理处理
常规
如何执行模型工具
1 | // get the model tool's parameter syntax from the model's help |
设置地理处理范围环境
1 | var parameters = Geoprocessing.MakeValueArray(@"C:\data\data.gdb\HighwaysUTM11", @"C:\data\data.gdb\Highways_extent"); |
在地理处理窗格中打开脚本工具对话框
1 | string input_data = @"C:\data\data.gdb\Population"; |
获取地理处理工程项目
1 | var gpItems = CoreModule.CurrentProject.Items.OfType<GeoprocessingProjectItem>(); |
阻止使用 GP 创建的要素类自动添加到地图
1 | // However, settings in Pro App's Geoprocessing Options will override option set in code |
GPExecuteToolFlags.AddToHistory 会将执行消息添加到 Hisotry
1 | // However, settings in Pro App's Geoprocessing Options will override option set in code |
多环缓冲器
1 | //The data referenced in this snippet can be downloaded from the arcgis-pro-sdk-community-samples repo |
地理处理工具的非阻塞执行
1 | //The data referenced in this snippet can be downloaded from the arcgis-pro-sdk-community-samples repo |
如何传递具有多个或复杂输入值的参数
1 | var environments = Geoprocessing.MakeEnvironmentArray(overwriteoutput: true); |
地理处理选项
获取地理处理选项
1 | //These options are for behavior of interactive GP tools _only_. |
设置地理处理选项
1 | //Note: changing these options modifies behavior of interactive GP tools _only_. |
图形图层
常规
创建图形图层
1 | var map = MapView.Active.Map; |
访问图形层
1 | //get the first graphics layer in the map's collection of graphics layers |
复制图形元素
1 | //on the QueuedTask |
删除图形元素
1 | //on the QueuedTask |
创建图形元素
使用 CIMG 图形元素的点图形元素
1 | var graphicsLayer = MapView.Active.Map.GetLayersAsFlattenedList() |
使用 CIMG 的线条图形元素
1 | //On the QueuedTask |
使用 CIMG 的多边形图形元素
1 | //On the QueuedTask |
使用 CIMG 的多点图形元素
1 | //On the QueuedTask |
使用 CIMSymbol 的图形元素
1 | var graphicsLayer = MapView.Active.Map.GetLayersAsFlattenedList() |
文本图形元素
1 | var graphicsLayer = MapView.Active.Map.GetLayersAsFlattenedList() |
批量图形创建
1 | //Point Feature layer to convert into graphics |
图形元素选择
选择图形元素
1 | var graphicsLayer = MapView.Active.Map.GetLayersAsFlattenedList() |
查找图形元素
1 | //on the QueuedTask |
所有图形图层中元素的空间选择
1 | //Map Tool is used to perform Spatial selection. |
在一个图形图层中对元素进行空间选择
1 | //on the QueuedTask |
选择文本图形元素
1 | var graphicsLayer = MapView.Active.Map.GetLayersAsFlattenedList() |
取消选择图形元素
1 | var graphicsLayer = MapView.Active.Map.GetLayersAsFlattenedList() |
图形元素事件
订阅元素选择更改事件
1 | ArcGIS.Desktop.Layouts.Events.ElementEvent.Subscribe((args) => { |
对图形元素进行分组和排序
组图形元素
1 | var graphicsLayer = MapView.Active.Map.GetLayersAsFlattenedList() |
取消组合图形元素
1 | var selectedElements = graphicsLayer.GetSelectedElements().ToList(); ; |
组元素的父级
1 | //check the parent |
排序:向后发送和向前发送
1 | //On the QueuedTask |
获取 Z 顺序
1 | var selElementsZOrder = graphicsLayer.GetSelectedElements(); |
修改图形元素
移动图形元素
1 | //Each selected element will move to a set distance to the upper right. |
修改图形元素的符号系统
1 | //within a queued Task |
布局
布局项目项
参考布局项目项及其关联布局
1 | //Reference layout project items and their associated layout. |
在新视图中打开布局项目项
1 | //Open a layout project item in a new view. |
激活已打开的布局视图
1 | //Activate an already open layout view. |
引用活动布局视图
1 | //Reference the active layout view. |
将 pagx 导入到项目中
1 | //Import a pagx into a project. |
删除布局项目项
1 | //Remove a layout project item. |
创建新的基本布局并将其打开
1 | //Create a new, basic layout and open it. |
使用修改后的 CIM 创建新布局并将其打开
1 | //Create a new layout using a modified CIM and open it. |
更改布局页面大小
1 | //Change the layout page size. |
ProSnippet Group CIM Graphics and GraphicFactory
创建圆形图形
1 | //Must be on QueuedTask.Run(() => { ... |
创建圆形文本图形
1 | //Must be on QueuedTask.Run(() => { ... |
创建贝塞尔图形
1 | //Must be on QueuedTask.Run(() => { ... |
创建图例图面图形
1 | //Must be on QueuedTask.Run(() => { ... |
创建箭头图形
1 | //Must be on QueuedTask.Run(() => { ... |
创建图片图形
1 | //Must be on QueuedTask.Run(() => { ... |
创建布局图形元素
创建椭圆图形元素
1 | //Must be on QueuedTask.Run(() => { ... |
创建套索线,手绘图形元素
1 | //Must be on QueuedTask.Run(() => { ... |
创建套索多边形,手绘元素
1 | //Must be on QueuedTask.Run(() => { ... |
创建线元素
1 | //Must be on QueuedTask.Run(() => { ... |
创建点元素
1 | //Must be on QueuedTask.Run(() => { ... |
创建多边形元素
1 | //Must be on QueuedTask.Run(() => { ... |
创建矩形元素
1 | //Must be on QueuedTask.Run(() => { ... |
创建贝塞尔曲线元素
1 | //Must be on QueuedTask.Run(() => { ... |
创建图形元素
1 | //Must be on QueuedTask.Run(() => { ... |
使用 CIMG 创建图形元素
1 | //on the QueuedTask |
使用 CIMSymbol 创建图形元素
1 | //Must be on QueuedTask.Run(() => { ... |
批量元素创建
1 | //Must be on QueuedTask.Run(() => { ... |
使用 CIMG 创建元素
1 | //Must be on QueuedTask.Run(() => { ... |
使用符号系统创建点图形
1 | //Create a simple 2D point graphic and apply an existing point style item as the symbology. |
使用符号系统创建线图形
1 | //Create a simple 2D line graphic and apply an existing line |
使用简单符号系统创建矩形图形
1 | //Create a simple 2D rectangle graphic and apply simple fill and |
创建文本图形元素
创建点文本元素 1
1 | //Create a simple point text element and assign basic symbology and text settings. |
创建矩形段落文本元素 1
1 | //Create rectangle text with background and border symbology. |
创建动态点文本元素
1 | //Create a dynamic text element. |
创建点文本元素 2
1 | //Must be on QueuedTask.Run(() => { ... |
创建多边形段落文本元素
1 | //Must be on QueuedTask.Run(() => { ... |
创建矩形段落文本元素 2
1 | //Must be on QueuedTask.Run(() => { ... |
创建圆形文本元素
1 | //Must be on QueuedTask.Run(() => { ... |
创建贝塞尔文本元素
1 | //Must be on QueuedTask.Run(() => { ... |
创建椭圆文本元素
1 | //Must be on QueuedTask.Run(() => { ... |
创建预定义的形状和箭头
创建预定义的形状图形元素
1 | //Must be on QueuedTask.Run(() => { ... |
创建预定义的形状图形元素
1 | //Must be on QueuedTask.Run(() => { ... |
创建预定义的形状图形元素
1 | //Must be on QueuedTask.Run(() => { ... |
创建线箭头元素
1 | //Must be on QueuedTask.Run(() => { ... |
图片元素
使用 CIMSymbol 创建图片图形元素
1 | //Must be on QueuedTask.Run(() => { ... |
使用高级符号设置创建新的图片元素
1 | //Create a picture element and also set background and border symbology. |
创建地图框和环绕要素
创建地图框并设置照相机
1 | //Create a map frame and set its camera by zooming to the extent of an existing bookmark. |
创建图例
1 | //Create a legend for an associated map frame. |
从样式项创建比例尺
1 | //Create a scale bar using a style. |
从样式项 1 创建指北针
1 | //Create a north arrow using a style. |
创建表格框
1 | //Create a table frame. |
创建地图框 1
1 | //Must be on QueuedTask.Run(() => { ... |
创建地图框 2
1 | //Must be on QueuedTask.Run(() => { ... |
创建图例 2
1 | //Must be on QueuedTask.Run(() => { ... |
从样式项 2 创建指北针
1 | //Must be on QueuedTask.Run(() => { ... |
创建表格框
1 | //Must be on QueuedTask.Run(() => { ... |
创建比例尺
1 | //Must be on QueuedTask.Run(() => { ... |
创建比例线
1 | //Must be on QueuedTask.Run(() => { ... |
组元素
创建空组元素
1 | //Create an empty group element at the root level of the contents pane |
创建包含元素的组元素
1 | //Create a group with a list of elements at the root level of the contents pane. |
布局元素和选择
在布局上查找元素
1 | //Find an element on a layout. |
查找布局元素
1 | //on the QueuedTask |
更新元素属性
1 | //Update an element's properties. |
获取元素选择计数
1 | //Get element's selection count. |
设置元素选择
1 | //Set the active layout view's selection to include 2 rectangle elements. |
取消选择布局上的元素
1 | //Unselect one element. |
在布局视图中取消选择元素
1 | LayoutView layoutView = LayoutView.Active; |
清除布局视图中的选择
1 | //If the a layout view is active, clear its selection |
清除布局中的所选内容
1 | //Clear the layout selection. |
复制布局元素
1 | //on the QueuedTask |
删除布局元素
1 | //on the QueuedTask |
删除布局上的一个或多个元素
1 | //Delete an element or elements on a layout. |
缩放到元素
1 | LayoutView lytView = LayoutView.Active; |
设置指北针的晕圈属性
1 | //Set the CIM halo properties of a north arrow. |
对图形元素进行分组和排序
组图形元素
1 | //on the QueuedTask |
取消组合图形元素
1 | var selectedElements = layout.GetSelectedElements().ToList(); |
组元素的父级
1 | //check the parent |
组元素中的子元素
1 | // Nested groups within ArcGIS.Desktop.Layouts.GroupElement are not preserved. |
排序:向后发送和向前发送
1 | //On the QueuedTask |
获取 Z 顺序
1 | var selElementsZOrder = layout.GetSelectedElements(); |
更新布局元素
更新文本元素属性
1 | //Update text element properties for an existing text element. |
更新图片元素
1 | //Update a picture element. |
将背景颜色应用于地图框
1 | //Apply a background color to the map frame element using the CIM. |
更新地图整饰
1 | //Update a map surround. |
锁定元素
1 | // The Locked property is displayed in the TOC as a lock symbol next |
更新元素透明度
1 | //Update an element's transparency using the CIM. |
克隆元素
1 | //Clone a layout graphic element and apply an offset. |
布局元数据
布局元数据
1 | //var layout = ...; |
布局地图框
更改与地图框关联的地图
1 | //Change the map associated with a map frame |
更改地图框照相机设置
1 | //Change a map frame's camera settings. |
将地图框缩放到单个图层的范围
1 | //Zoom map frame to the extent of a single layer. |
将地图框范围更改为多个图层中的所选要素
1 | //Change the extent of a map frame to the selected features multiple layers. |
将地图框范围更改为具有 15% 缓冲区的单个要素
1 | //Change map frame extent to single feature with 10 percent buffer |
将页面坐标中的点转换为地图坐标中的点。
1 | //On the QueuedTask |
将地图坐标中的点转换为页面坐标中的点
1 | internal class GetMapCoordinates : MapTool |
布局图系列
修改现有地图系列
1 | //Modify the currently active map series and changes its sort field and page number field. |
创建新的空间地图系列
1 | // This example create a new spatial map series and then applies it to the active layout. This will automatically |
布局导出
将布局导出为 PDF
1 | //Export a single page layout to PDF. |
将地图框导出为 JPG
1 | //Export a map frame to JPG. |
将与地图框关联的地图视图导出到 BMP
1 | //Export the map view associated with a map frame to BMP. |
将地图系列导出为单个 PDF
1 | //Export a map series with multiple pages to a single PDF. |
将地图系列导出到单个 TIFF 文件
1 | //Export each page of a map series to an individual TIFF file. |
布局选项
获取布局选项
1 | var lastToolActive = ApplicationOptions.LayoutOptions.KeepLastToolActive; |
设置布局选项
1 | //keep graphic element insert tool active |
文本和图形元素选项
获取所有可用字体
1 | //Note: see also SymbolFactory.Instance.GetAvailableFonts() which returns the |
获取文本和图形元素选项
1 | QueuedTask.Run(() => |
设置文本和图形元素选项
1 | QueuedTask.Run(() => |
MapFrame_Display_Constraints
设置自动相机无
1 | var layout = LayoutView.Active.Layout; |
设置自动相机固定范围
1 | var layout = LayoutView.Active.Layout; |
设置自动相机固定中心
1 | var layout = LayoutView.Active.Layout; |
设置自动相机固定居中和缩放
1 | var layout = LayoutView.Active.Layout; |
设置自动相机固定比例
1 | var layout = LayoutView.Active.Layout; |
设置自动照相机链接范围
1 | var layout = LayoutView.Active.Layout; |
设置自动相机链接中心
1 | var layout = LayoutView.Active.Layout; |
设置自动相机链接中心和缩放
1 | var layout = LayoutView.Active.Layout; |
设置自动相机链接缩放
1 | var layout = LayoutView.Active.Layout; |
设置自动相机链接地图系列形状
1 | var layout = LayoutView.Active.Layout; |
设置自动相机链接地图系列中心
1 | var layout = LayoutView.Active.Layout; |
布局-报告
报告项目项
获取当前项目中的所有报表
1 | var projectReports = Project.Current.GetItems<ReportProjectItem>(); |
获取特定报告
1 | ReportProjectItem reportProjItem = Project.Current.GetItems<ReportProjectItem>().FirstOrDefault(item => item.Name.Equals(reportName)); |
在新视图中打开报表项目项
1 | //Open a report project item in a new view. |
激活已打开的报告视图
1 | Report report = Project.Current.GetItems<ReportProjectItem>().FirstOrDefault().GetReport(); |
引用活动报表视图
1 | //Confirm if the current, active view is a report view. If it is, do something. |
刷新报表视图
1 | if (reportView == null) |
缩放到整个页面
1 | QueuedTask.Run(() => reportView.ZoomToWholePage()); |
缩放到报表视图上的特定位置
1 | //On the QueuedTask |
缩放到页面宽度
1 | //Process on worker thread |
创建报告
创建报告
1 | //Note: Call within QueuedTask.Run() |
将报告导出为 pdf
1 | //Note: Call within QueuedTask.Run() |
导入报告文件
1 | //Note: Call within QueuedTask.Run() |
删除报表
1 | //Note: Call within QueuedTask.Run() |
修改报表
重命名报表
1 | //Note: Call within QueuedTask.Run() |
修改报表定义查询
1 | //Note: Call within QueuedTask.Run() |
修改报表页
1 | //Note: Call within QueuedTask.Run() |
添加子报表
1 | //Note: Call within QueuedTask.Run() |
报表设计
获取报告模板
1 | //Report Template Styles: |
获取报表样式
1 | //Report Styling: |
报表元素
获取各种报告部分
1 | //Get the "ReportSection element" |
选择元素
1 | //ReportDetailsSection contains the "Fields" |
选择所有元素
1 | //Select all elements in the Report Footer. |
获取所选元素
1 | IReadOnlyList<Element> selectedElements = report.GetSelectedElements(); |
缩放至所选元素
1 | QueuedTask.Run(() => reportView.ZoomToSelectedElements()); |
清晰的元素选择
1 | reportView.ClearElementSelection(); |
根据名称查找报表中的特定元素。
1 | var reportElementsToFind = new List<string> { "ReportText1", "ReportText2" }; |
删除元素
1 | QueuedTask.Run(() => report.DeleteElements(textReportElements)); |
在报表中创建新字段
1 | //This is the gap between two fields |
地图创作
地图
获取活动地图
1 | Map map = MapView.Active.Map; |
使用默认底图图层创建新地图
1 | await QueuedTask.Run(() => |
在工程中查找地图并将其打开
1 | public static async Task<Map> FindOpenExistingMapAsync(string mapName) |
打开 web 地图
1 | Map map = null; |
获取地图窗格
1 | public static IEnumerable<IMapPane> GetMapPanes() |
从地图窗格中获取唯一的地图列表
1 | public static IReadOnlyList<Map> GetMapsFromMapPanes() |
更改地图名称
1 | MapView.Active.Map.SetName("Test"); |
重命名窗格的标题
1 | ProApp.Panes.ActivePane.Caption = "Caption"; |
将地图转换为局部场景
1 | //Note: Run within the context of QueuedTask.Run |
获取底图
1 | //Basemaps stored locally in the project. This is usually an empty collection |
将地图另存为 MapX
1 | map.SaveAsFile(@"C:\Data\MyMap.mapx", true); |
将 2D 地图另存为 Web 地图 在磁盘上
1 | //2D maps only |
裁剪映射到提供的裁剪多边形
1 | //Run within QueuedTask |
清除当前地图剪辑几何
1 | //Run within QueuedTask |
获取地图裁剪几何
1 | var map = MapView.Active.Map; |
获取当前地图位置单元
1 | //var map = MapView.Active.Map; |
获取可用的地图位置单位列表
1 | //var map = MapView.Active.Map; |
使用当前地图位置单元设置位置格式
1 | var mv = MapView.Active; |
设置当前地图的位置单位
1 | var mv = MapView.Active; |
获取当前地图高程单位
1 | //var map = MapView.Active.Map; |
获取可用的地图高程单位列表
1 | //var map = MapView.Active.Map; |
使用当前地图高程单位设置高程格式
1 | var mv = MapView.Active; |
设置当前地图的高程单位
1 | var map = MapView.Active.Map; |
离线地图
检查地图是否具有启用同步的内容
1 | //namespace ArcGIS.Desktop.Mapping.Offline |
为启用同步的内容生成副本
1 | //namespace ArcGIS.Desktop.Mapping.Offline |
检查地图是否具有本地可同步内容
1 | //namespace ArcGIS.Desktop.Mapping.Offline |
同步可同步内容的副本
1 | //namespace ArcGIS.Desktop.Mapping.Offline |
删除可同步内容的副本
1 | //namespace ArcGIS.Desktop.Mapping.Offline |
导出地图栅格切片缓存内容
1 | //namespace ArcGIS.Desktop.Mapping.Offline |
导出地图矢量切片缓存内容
1 | //namespace ArcGIS.Desktop.Mapping.Offline |
创建图层
创建图层并将其添加到活动地图
1 | /* |
使用创建参数创建图层
1 | var flyrCreatnParam = new FeatureLayerCreationParams(new Uri(@"c:\data\world.gdb\cities")) |
创建要素图层并使用图层创建参数添加到地图
1 | //Note: Call within QueuedTask.Run() |
创建要素图层并设置为不显示在地图中。
1 | //The catalog path of the feature layer to add to the map |
使用渲染器创建要素图层
1 | //Note: Call within QueuedTask.Run() |
使用查询定义创建要素图层
1 | //The catalog path of the feature layer to add to the map |
将地图注释添加到活动地图
1 | //Gets the collection of layer template packages installed with Pro for use with maps |
应用目录中图层的符号系统
1 | //Note: Call within QueuedTask.Run() |
创建新的子类型图层组
1 | var subtypeGroupLayerCreateParam = new SubtypeGroupLayerCreationParams |
从 lyrx 文件创建图层
1 | var lyrDocFromLyrxFile = new LayerDocument(@"d:\data\cities.lyrx"); |
将符号系统应用于图层文件中的图层
1 | //Note: Run within QueuedTask.Run |
添加 WMS 服务
1 | // Create a connection to the WMS server |
添加 WFS 服务
1 | CIMStandardDataConnection cIMStandardDataConnection = new CIMStandardDataConnection() |
添加和更改 WMS 服务图层的样式
1 | var serverConnection = new CIMInternetServerConnection { URL = "https://spritle.esri.com/arcgis/services/sanfrancisco_sld/MapServer/WMSServer" }; |
创建查询图层
1 | await QueuedTask.Run(() => |
使用默认值分类间隔渲染器创建要素图层
1 | await QueuedTask.Run(() => |
使用分类间隔渲染器创建要素图层
1 | string colorBrewerSchemesName = "ColorBrewer Schemes (RGB)"; |
底图图层
更新地图的底图图层
1 | aMap.SetBasemapLayers(Basemap.Gray); |
从地图中移除底图图层
1 | aMap.SetBasemapLayers(Basemap.None); |
使用图层
从地图中获取按图层类型过滤的图层列表
1 | List<FeatureLayer> featureLayerList = aMap.GetLayersAsFlattenedList().OfType<FeatureLayer>().ToList(); |
获取特定几何类型的图层
1 | //Get an existing Layer. This layer has a symbol you want to use in a new layer. |
查找图层
1 | //Finds layers by name and returns a read only list of Layers |
查找独立表
1 | // these routines find a standalone table whether it is a child of the Map or a GroupLayer |
使用部分名称搜索查找图层
1 | Map map = MapView.Active.Map; |
更改图层可见性、可编辑性、捕捉性
1 | if (!layer.IsVisible) |
创建 Lyrx 文件
1 | LayerDocument layerDocument = new LayerDocument(layer); |
计算图层上所选要素的数量
1 | var lyr = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(); |
访问图层的显示字段
1 | var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(); |
在图层上启用标注
1 | var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(); |
将 2D 组中的图层移动到局部场景中的 3D 组
1 | //The layer in the 2D group to move to the 3D Group in a Local Scene |
重置要素服务图层的 URL
1 | CIMStandardDataConnection dataConnection = dataConnectionLayer.GetDataConnection() as CIMStandardDataConnection; |
更改要素图层的基础数据源 - 相同的工作空间类型
1 | //This is the existing layer for which we want to switch the underlying datasource |
将图层的地理数据库版本更改为地图中的指定版本
1 | await QueuedTask.Run(() => |
查询要素图层
1 | var count = await QueuedTask.Run(() => |
获取图层的属性旋转字段
1 | var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(); |
查找要旋转的连接属性字段
1 | var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(); |
切换“设置参考比例时缩放图层符号”
1 | var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(); |
设置图层缓存
1 | var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(); |
更改图层选择颜色
1 | var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(); |
删除所有未选中的图层
1 | var map = MapView.Active.Map; |
删除空组
1 | var map = MapView.Active.Map; |
在地图定义中创建缩写字典并将其应用于图层
1 | public static void CreateDictionary() |
属性表 - ITablePane
设置属性表的缩放级别
1 | if (FrameworkApplication.Panes.ActivePane is ITablePane tablePane) |
检索属性表中所选像元的值
1 | if (FrameworkApplication.Panes.ActivePane is ITablePane tablePane) |
移动到特定行
1 | if (FrameworkApplication.Panes.ActivePane is ITablePane tablePane) |
元数据
获取和设置地图元数据
1 | var map = MapView.Active.Map; |
图层元数据
1 | MapMember mapMember = map.GetLayersAsFlattenedList().FirstOrDefault(); //Search for only layers/tables here if needed. |
渲染器
将唯一值渲染器设置为活动地图的所选要素图层
1 | await QueuedTask.Run(() => |
创建一个唯一值呈现器以指定值的符号
1 | return QueuedTask.Run(() => |
创建热图渲染器
1 | string colorBrewerSchemesName = "ArcGIS Colors"; |
创建未分类渲染器
1 | string colorBrewerSchemesName = "ArcGIS Colors"; |
创建最大和最小符号大小上限的比例渲染器
1 | string colorBrewerSchemesName = "ArcGIS Colors"; |
创建真实比例渲染器
1 | string colorBrewerSchemesName = "ArcGIS Colors"; |
拱廊
使用 Arcade 修改渲染器
1 | var lyr = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(f => f.ShapeType == esriGeometryType.esriGeometryPolygon); |
使用 Arcade 修改标注表达式
1 | var lyr = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(f => f.ShapeType == esriGeometryType.esriGeometryPolygon); |
高程表面图层
创建具有地表图层的场景
1 | // wrap in QueuedTask.Run |
创建新的高程表面
1 | //Note: call within QueuedTask.Run() |
将自定义高程表面设置为 Z 感知图层
1 | //Define the custom elevation surface to use |
将高程源添加到现有高程表面图层
1 | // wrap in QueuendTask.Run |
从地图中获取高程表面图层和高程源图层
1 | // retrieve the elevation surface layers in the map including the Ground |
查找高程表面图层
1 | var surfaceLayers = map.GetElevationSurfaceLayers(); |
移除高程表面图层
1 | // wrap in a QueuedTask.Run |
从曲面获取 Z 值
1 | var geometry = await QueuedTask.Run<Geometry>(() => |
栅格图层
创建栅格图层
1 | string url = @"C:\Images\Italy.tif"; |
更新栅格图层上的栅格着色器
1 | await QueuedTask.Run(() => |
更新栅格图层上的 RGB 着色器
1 | await QueuedTask.Run(() => |
检查是否可以将某个着色器应用于栅格图层
1 | await QueuedTask.Run(() => |
基于默认着色器定义创建新的着色器并将其应用于栅格图层
1 | await QueuedTask.Run(async () => |
基于自定义着色器定义创建新的着色器并将其应用于栅格图层
1 | await QueuedTask.Run(async () => |
使用新的着色器定义创建栅格图层
1 | // Create a new stretch colorizer definition using default constructor. |
马赛克图层
创建镶嵌图层
1 | MosaicLayer mosaicLayer = null; |
更新镶嵌图层上的栅格着色器
1 | await QueuedTask.Run(() => |
更新镶嵌图层上的 RGB 着色器
1 | await QueuedTask.Run(() => |
检查是否可以将某种着色器应用于马赛克图层
1 | await QueuedTask.Run(() => |
基于默认着色器定义创建新的着色器并将其应用于镶嵌图层
1 | await QueuedTask.Run(async () => |
基于自定义着色器定义创建新的着色器并将其应用于镶嵌图层
1 | await QueuedTask.Run(async () => |
使用新的着色器定义创建镶嵌图层
1 | // Create a new colorizer definition using default constructor. |
更新镶嵌图层上的排序顺序 - 镶嵌方法
1 | await QueuedTask.Run(() => |
更新镶嵌图层上的解析重叠 - 镶嵌运算符
1 | await QueuedTask.Run(() => |
影像服务图层
创建影像服务图层
1 | ImageServiceLayer isLayer = null; |
更新影像服务图层上的栅格着色器
1 | await QueuedTask.Run(() => |
更新影像服务图层上的 RGB 着色器
1 | await QueuedTask.Run(() => |
检查是否可以将特定着色器应用于影像服务图层
1 | await QueuedTask.Run(() => |
基于默认着色器定义创建新的着色器并将其应用于影像服务图层
1 | await QueuedTask.Run(async () => |
基于自定义着色器定义创建新的着色器并将其应用于影像服务图层
1 | await QueuedTask.Run(async () => |
使用新的着色器定义创建影像服务图层
1 | // Create a new colorizer definition using default constructor. |
更新影像服务图层上的排序顺序 - 镶嵌方法
1 | await QueuedTask.Run(() => |
更新影像服务图层上的解决重叠 - 镶嵌运算符
1 | await QueuedTask.Run(() => |
使用独立表
创建独立表
1 | //container can be a map or group layer |
从表的容器中检索表
1 | var container = MapView.Active.Map; |
移动独立表
1 | //get the first group layer that has at least one table |
删除独立表
1 | //get the first group layer that has at least one table |
符号图层绘制 (SLD)
添加 SLD
1 | QueuedTask.Run(() => |
确定图层是否添加了 SLD
1 | //SLD can be added to feature layers and group layers |
启用/禁用 SLD
1 | QueuedTask.Run(() => |
设备位置 API、GPS/GNSS 设备
连接到设备位置源
1 | var newSrc = new SerialPortDeviceLocationSource(); |
获取当前设备位置源
1 | var source = DeviceLocationService.Instance.GetSource(); |
关闭当前设备位置源
1 | //Is there a current device source? |
获取当前设备位置源和属性
1 | bool isConnected = DeviceLocationService.Instance.IsDeviceConnected(); |
更新当前设备位置源上的属性
1 | await QueuedTask.Run(() => |
订阅设备位置属性更新事件
1 | private void SubscribeToPropertiesEvents() |
订阅设备位置源更改事件
1 | private void SubscribeToSourceEvents() |
映射设备位置选项
启用/禁用地图的当前设备位置源
1 | bool enabled = MapDeviceLocationService.Instance.IsDeviceLocationEnabled; |
获取当前地图设备位置选项
1 | var options = MapDeviceLocationService.Instance.GetDeviceLocationOptions(); |
检查地图上是否启用了当前设备位置
1 | if (MapDeviceLocationService.Instance.IsDeviceLocationEnabled) |
设置当前地图设备位置选项
1 | //Must be on the QueuedTask.Run() |
缩放/平移地图到最新位置
1 | //Must be on the QueuedTask.Run() |
将最新位置添加到图形图层
1 | //var graphicsLayer = ... ; |
订阅位置快照事件
1 | private void SubscribeToSnapshotEvents() |
特征遮罩
获取要素的遮罩几何
1 | var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList() |
风格管理
如何按名称获取项目中的样式
1 | //Get all styles in the project |
如何创建新样式
1 | //Full path for the new style file (.stylx) to be created |
如何向项目添加样式
1 | //For ArcGIS Pro system styles, just pass in the name of the style to add to the project |
如何从项目中删除样式
1 | //For ArcGIS Pro system styles, just pass in the name of the style to remove from the project |
如何将样式项添加到样式
1 | public Task AddStyleItemAsync(StyleProjectItem style, StyleItem itemToAdd) |
如何从样式中删除样式项
1 | public Task RemoveStyleItemAsync(StyleProjectItem style, StyleItem itemToRemove) |
如何确定样式是否可以升级
1 | //Pass in the full path to the style file on disk |
如何确定样式是否为只读
1 | //Pass in the full path to the style file on disk |
如何确定样式是否为当前样式
1 | //Pass in the full path to the style file on disk |
如何升级样式
1 | //Pass in the full path to the style file on disk |
符号
如何构建特定颜色和大小的点符号
1 | await QueuedTask.Run(() => |
如何构建特定颜色、大小和形状的点符号
1 | await QueuedTask.Run(() => |
如何根据标记构造点符号
1 | await QueuedTask.Run(() => |
如何从磁盘上的文件构造点符号
1 | //The following file formats can be used to create the marker: DAE, 3DS, FLT, EMF, JPG, PNG, BMP, GIF |
如何从内存图形构造点符号
1 | //Create a stream for the image |
如何构造特定颜色和填充样式的面符号
1 | CIMPolygonSymbol polygonSymbol = SymbolFactory.Instance.ConstructPolygonSymbol(ColorFactory.Instance.RedRGB, SimpleFillStyle.Solid); |
如何构建特定颜色、填充样式和轮廓的多边形符号
1 | CIMStroke outline = SymbolFactory.Instance.ConstructStroke(ColorFactory.Instance.BlueRGB, 2.0, SimpleLineStyle.Solid); |
如何在没有轮廓的情况下构建面符号
1 | CIMPolygonSymbol fillWithoutOutline = SymbolFactory.Instance.ConstructPolygonSymbol(ColorFactory.Instance.RedRGB, SimpleFillStyle.Solid, null); |
如何构建特定颜色、大小和线条样式的线符号
1 | CIMLineSymbol lineSymbol = SymbolFactory.Instance.ConstructLineSymbol(ColorFactory.Instance.BlueRGB, 4.0, SimpleLineStyle.Solid); |
如何根据笔划构造线条符号
1 | CIMStroke stroke = SymbolFactory.Instance.ConstructStroke(ColorFactory.Instance.BlackRGB, 2.0); |
如何构建线端带有圆形标记的多图层线符号
1 | //These methods must be called within the lambda passed to QueuedTask.Run |
如何构建末端带有箭头的多图层线符号
1 | //These methods must be called within the lambda passed to QueuedTask.Run |
如何从符号获取符号引用
1 | CIMPolygonSymbol symbol = SymbolFactory.Instance.ConstructPolygonSymbol(ColorFactory.Instance.RedRGB); |
修改从字符标记创建的点符号
1 | //create marker from the Font, char index,size,color |
获取可用字体的列表
1 | //Must use QueuedTask.Run(...) |
获取/设置默认字体
1 | //Must use QueuedTask.Run(...) |
使用选项构建文本符号
1 | QueuedTask.Run(() => |
为给定符号创建色板
1 | //Note: call within QueuedTask.Run() |
查找符号
1 | //Note: Run within QueuedTask.Run |
符号搜索
如何在样式中搜索特定项目
1 | public Task<SymbolStyleItem> GetSymbolFromStyleAsync(StyleProjectItem style, string key) |
如何在样式中搜索点符号
1 | public Task<IList<SymbolStyleItem>> GetPointSymbolsFromStyleAsync(StyleProjectItem style, string searchString) |
如何在样式中搜索线符号
1 | public Task<IList<SymbolStyleItem>> GetLineSymbolsFromStyleAsync(StyleProjectItem style, string searchString) |
如何在样式中搜索面符号
1 | public async Task<IList<SymbolStyleItem>> GetPolygonSymbolsFromStyleAsync(StyleProjectItem style, string searchString) |
如何在样式中搜索颜色
1 | public async Task<IList<ColorStyleItem>> GetColorsFromStyleAsync(StyleProjectItem style, string searchString) |
如何在样式中搜索色带
1 | public async Task<IList<ColorRampStyleItem>> GetColorRampsFromStyleAsync(StyleProjectItem style, string searchString) |
如何在样式中搜索指北针
1 | public Task<IList<NorthArrowStyleItem>> GetNorthArrowsFromStyleAsync(StyleProjectItem style, string searchString) |
如何在样式中搜索比例尺
1 | public Task<IList<ScaleBarStyleItem>> GetScaleBarsFromStyleAsync(StyleProjectItem style, string searchString) |
如何在样式中搜索标签展示位置
1 | public Task<IList<LabelPlacementStyleItem>> GetLabelPlacementsFromStyleAsync(StyleProjectItem style, string searchString) |
如何在样式中搜索图例
1 | public Task<IList<LegendStyleItem>> GetLegendFromStyleAsync(StyleProjectItem style, string searchString) |
如何在样式中搜索图例项
1 | public Task<IList<LegendItemStyleItem>> GetLegendItemsFromStyleAsync(StyleProjectItem style, string searchString) |
如何在样式中搜索网格
1 | public Task<IList<GridStyleItem>> GetGridsFromStyleAsync(StyleProjectItem style, string searchString) |
如何在样式中搜索地图整饰
1 | public Task<IList<MapSurroundStyleItem>> GetMapSurroundsFromStyleAsync(StyleProjectItem style, string searchString) |
如何在样式中搜索表格框
1 | public Task<IList<TableFrameStyleItem>> GetTableFramesFromStyleAsync(StyleProjectItem style, string searchString) |
如何在样式中搜索表格框字段
1 | public Task<IList<TableFrameFieldStyleItem>> GetTableFrameFieldsFromStyleAsync(StyleProjectItem style, string searchString) |
要素图层符号系统
如何为使用简单渲染器符号化的要素图层设置符号
1 | public Task SetFeatureLayerSymbolAsync(FeatureLayer ftrLayer, CIMSymbol symbolToApply) |
如何将样式中的符号应用于要素图层
1 | public Task SetFeatureLayerSymbolFromStyleItemAsync( |
如何将样式中的点符号应用于要素图层
1 | // var map = MapView.Active.Map; |
如何将样式的色带应用于要素图层
1 | public async Task ApplyColorRampAsync(FeatureLayer featureLayer, List<string> fields) |
地图创作-注释片段
创建注记构造工具
1 | //In your config.daml...set the categoryRefID |
通过属性更新批注文本。警告:TEXTSTRING Anno 属性必须存在
1 | //See "Change Annotation Text Graphic" for an alternative if TEXTSTRING is missing from the schema |
旋转或移动批注
1 | await QueuedTask.Run(() => |
获取批注文本图形
1 | await QueuedTask.Run(() => |
获取注释的轮廓几何图形
1 | var annoLayer = MapView.Active.Map.GetLayersAsFlattenedList() |
获取注释的遮罩几何图形
1 | var annoLayer = MapView.Active.Map.GetLayersAsFlattenedList() |
地图创作标记代码段
获取活动地图的标注引擎 - Maplex 或标准标注引擎
1 | //Note: call within QueuedTask.Run() |
将活动地图的标注引擎从标准更改为 Maplex,反之亦然
1 | //Note: call within QueuedTask.Run() |
将文本符号应用于要素图层
1 | //Note: call within QueuedTask.Run() |
启用图层标注
1 | //Note: call within QueuedTask.Run() |
修改标签的位置/位置 - 点几何
1 | //Note: call within QueuedTask.Run() |
修改标签的位置/位置 - 线几何
1 | //Note: call within QueuedTask.Run() |
修改标注的位置/位置 - 多边形几何
1 | //Note: call within QueuedTask.Run() |
使用 MaplexEngine 修改标注的方向 - 点和面几何
1 | //Note: call within QueuedTask.Run() |
使用 MaplexEngine - 线几何修改标注的方向
1 | //Note: call within QueuedTask.Run() |
修改标签旋转 - 点几何
1 | //Note: call within QueuedTask.Run() |
在多边形几何中展开标注
1 | //Note: call within QueuedTask.Run() |
修改标签的引出线锚点属性 - 多边形几何
1 | //Note: call within QueuedTask.Run() |
地图创作-体素图层
创建体素图层
检查是否可以创建体素图层
1 | //Map must be a local scene |
创建体素图层
1 | //Must be on the QueuedTask.Run() |
体素图层设置和属性
从目录中获取体素图层
1 | //Get selected layer if a voxel layer is selected |
操作体素图层目录组
1 | //var voxelLayer = ... |
从目录中获取/设置选定的体素资源
1 | var surfaces = MapView.Active.GetSelectedIsosurfaces(); |
更改体素可视化效果
1 | //var voxelLayer = ... ; |
照明属性、偏移、垂直夸大
1 | //var voxelLayer = ... ; |
获取体素体积维度
1 | //At 2.x - var volume = voxelLayer.GetVolumeSize(); |
事件
订阅对体素图层的更改
1 | ArcGIS.Desktop.Mapping.Events.MapMemberPropertiesChangedEvent.Subscribe((args) => |
变量配置文件 + 渲染器
获取选定的变量配置文件
1 | //var voxelLayer = ... ; |
更改选定的变量配置文件
1 | //var voxelLayer = ... ; |
获取变量配置文件
1 | //var voxelLayer = ... ; |
获取变量渲染器
1 | //var voxelLayer = ... ; |
访问拉伸渲染器的统计信息和颜色范围
1 | //var voxelLayer = ... ; |
更改拉伸渲染器颜色范围
1 | //Typically, the default color range covers the most |
更改 CIMVoxelColorUniqueValue 类的可见性
1 | //Get the variable profile whose renderer will be changed |
等值面
检查变量的最大等值面数
1 | //var voxelLayer = ... ; |
检查变量的数据类型
1 | //var voxelLayer = ... ; |
检查CanCreateIsoSurface
1 | //var voxelLayer = ... ; |
创建等值面
1 | //var voxelLayer = ... ; |
如何更改等值面上的值和颜色
1 | //var voxelLayer = ... ; |
将 Isourface 颜色更改回默认值
1 | //var voxelLayer = ... ; |
删除等值面
1 | //var voxelLayer = ... ; |
片
获取切片集合
1 | //var voxelLayer = ... ; |
获取切片
1 | //var voxelLayer = ... ; |
获取目录中的选定切片
1 | //Must be on the QueuedTask.Run() |
获取目录中所选切片的体素图层
1 | //Must be on the QueuedTask.Run() |
创建切片
1 | //var voxelLayer = ... ; |
更改切片的倾斜度
1 | //var voxelLayer = ... ; |
删除切片
1 | //var voxelLayer = ... ; |
部分
获取部分
1 | //var voxelLayer = ... ; |
获取当前部分集合
1 | //var voxelLayer = ... ; |
获取目录中的选定部分
1 | //var voxelLayer = ... ; |
获取目录中所选部分的体素图层
1 | //var voxelLayer = ... ; |
在体素中点处创建一个剖面
1 | //var voxelLayer = ... ; |
创建水平剖面
1 | //var voxelLayer = ... ; |
以圆形模式创建截面
1 | //var voxelLayer = ... ; |
创建将体素平分的部分
1 | //var voxelLayer = ... ; |
在体素对角线上创建截面
1 | //var voxelLayer = ... ; |
更新截面方向和倾斜度
1 | //var voxelLayer = ... ; |
更新版块可见性
1 | //var voxelLayer = ... ; |
删除部分
1 | //var voxelLayer = ... ; |
锁定部分
获取锁定部分的当前集合
1 | //var voxelLayer = ... ; |
获取锁定的部分
1 | //var voxelLayer = ... ; |
在目录中获取选定的锁定部分
1 | //var voxelLayer = ... ; |
获取目录中所选锁定部分的体素图层
1 | //var voxelLayer = ... ; |
为选定的锁定部分设置活动的变量配置文件
1 | //Must be on the QueuedTask.Run() |
锁定分区/“创建”锁定分区
1 | //var voxelLayer = ... ; |
更新锁定部分可见性
1 | //var voxelLayer = ... ; |
解锁锁定部分
1 | //var voxelLayer = ... ; |
删除锁定的分区
1 | //var voxelLayer = ... ; |
地图探索
地图视图
测试视图是否为 3D 视图
1 | public bool IsView3D() |
设置查看模式
1 | public void SetViewingModeToSceneLocal() |
启用视图链接
1 | public void EnableViewLinking() |
更新地图视图范围(缩放、平移等)
转到上一个相机
1 | public Task<bool> ZoomToPreviousCameraAsync() |
转到下一个相机
1 | public Task<bool> ZoomToNextCameraAsync() |
缩放至全图范围
1 | public Task<bool> ZoomToFullExtent() |
固定放大
1 | public Task<bool> ZoomInFixed() |
固定缩小
1 | public Task<bool> ZoomOutFixed() |
缩放至某个范围
1 | public Task<bool> ZoomToExtent(double xMin, double yMin, double xMax, double yMax, ArcGIS.Core.Geometry.SpatialReference spatialReference) |
缩放至点
1 | public Task<bool> ZoomToPoint(double x, double y, ArcGIS.Core.Geometry.SpatialReference spatialReference) |
缩放至所选要素
1 | public Task<bool> ZoomToSelected() |
按名称缩放至书签
1 | public Task<bool> ZoomToBookmark(string bookmarkName) |
缩放至可见图层
1 | public Task<bool> ZoomToAllVisibleLayersAsync() |
缩放至所选图层
1 | public Task<bool> ZoomToTOCSelectedLayersAsync() |
在一定程度上平移
1 | public Task<bool> PanToExtent(double xMin, double yMin, double xMax, double yMax, ArcGIS.Core.Geometry.SpatialReference spatialReference) |
平移到所选要素
1 | public Task<bool> PanToSelected() |
平移到书签
1 | public Task<bool> PanToBookmark(string bookmarkName) |
平移到可见图层
1 | public Task<bool> PanToAllVisibleLayersAsync() |
异步平移到所选图层
1 | public Task<bool> PanToTOCSelectedLayersAsync() |
旋转地图视图
1 | public Task<bool> RotateView(double heading) |
展开范围
1 | public Task<bool> ExpandExtentAsync(double dx, double dy) |
地图
获取活动地图的名称
1 | public string GetActiveMapName() |
清除活动地图中的所有选择
1 | QueuedTask.Run(() => |
以地图单位计算选择容差
1 | //Selection tolerance for the map in pixels |
地图视图叠加控制
1 | //Creat a Progress Bar user control |
层
选择目录中的所有要素图层
1 | public void SelectAllFeatureLayersInTOC() |
闪烁所选功能
1 | public Task FlashSelectedFeaturesAsync() |
检查图层在给定的地图视图中是否可见
1 | var mapView = MapView.Active; |
选择一个图层并打开其图层属性页面
1 | // get the layer you want |
清除特定图层的选择
1 | var lyr = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(); |
地图成员的显示表窗格
1 | var mapMember = MapView.Active.Map.GetLayersAsFlattenedList().OfType<MapMember>().FirstOrDefault(); |
特征
遮罩功能
1 | //Get the layer to be masked |
弹出窗口
显示要素的弹出窗口
1 | public void ShowPopup(MapMember mapMember, long objectID) |
显示自定义弹出窗口
1 | public void ShowCustomPopup() |
使用弹出窗口属性显示要素的弹出窗口
1 | public void ShowPopupWithWindowDef(MapMember mapMember, long objectID) |
使用弹出窗口属性显示自定义弹出窗口
1 | public void ShowCustomPopupWithWindowDef() |
显示带有自定义命令的弹出窗口
1 | public void ShowCustomPopup(MapMember mapMember, long objectID) |
显示动态弹出窗口
1 | public void ShowDynamicPopup(MapMember mapMember, List<long> objectIDs) |
书签
使用活动地图视图创建新书签
1 | public Task<Bookmark> AddBookmarkAsync(string name) |
从联昌国际添加新书签
1 | public Task<Bookmark> AddBookmarkFromCameraAsync(Camera camera, string name) |
获取项目的书签集合
1 | public Task<ReadOnlyObservableCollection<Bookmark>> GetProjectBookmarksAsync() |
获取地图书签
1 | public Task<ReadOnlyObservableCollection<Bookmark>> GetActiveMapBookmarksAsync() |
将书签移到顶部
1 | public Task MoveBookmarkToTopAsync(Map map, string name) |
重命名书签
1 | public Task RenameBookmarkAsync(Bookmark bookmark, string newName) |
删除具有给定名称的书签
1 | public Task RemoveBookmarkAsync(Map map, string name) |
更改书签的缩略图
1 | public Task SetThumbnailAsync(Bookmark bookmark, string imagePath) |
更新书签
1 | public Task UpdateBookmarkAsync(Bookmark bookmark) |
更新书签的范围
1 | public Task UpdateBookmarkExtentAsync(Bookmark bookmark, ArcGIS.Core.Geometry.Envelope envelope) |
时间
时间提前 1 个月
1 | public void StepMapTime() |
禁用地图中的时间。
1 | MapView.Active.Time.Start = null; |
动画
设置动画长度
1 | public void SetAnimationLength(TimeSpan length) |
缩放动画
1 | public void ScaleAnimationAfterTime(TimeSpan afterTime, TimeSpan length) |
相机关键帧
1 | public List<CameraKeyframe> GetCameraKeyframes() |
插值相机
1 | public Task<List<Camera>> GetInterpolatedCameras() |
插值时间
1 | public Task<List<TimeRange>> GetInterpolatedMapTimes() |
插值范围
1 | public Task<List<ArcGIS.Desktop.Mapping.Range>> GetInterpolatedMapRanges() |
创建摄像机关键帧
1 | public void CreateCameraKeyframe(TimeSpan atTime) |
创建时间关键帧
1 | public void CreateTimeKeyframe(TimeSpan atTime) |
创建范围关键帧
1 | public void CreateRangeKeyframe(ArcGIS.Desktop.Mapping.Range range, TimeSpan atTime) |
创建图层关键帧
1 | public void CreateLayerKeyframe(Layer layer, double transparency, TimeSpan atTime) |
图形叠加
图形叠加
1 | //Defined elsewhere |
图形叠加与 CIMPicture图形
1 | // get the current mapview |
添加带有文本的叠加图形
1 | internal class AddOverlayWithText : MapTool |
工具
更改草图工具的符号
1 | internal class SketchTool_WithSymbol : MapTool |
创建用于地图中单击的点的返回坐标的工具
1 | internal class GetMapCoordinates : MapTool |
创建用于识别与草图几何相交的特征的工具
1 | internal class CustomIdentify : MapTool |
更改工具的光标
1 | internal class CustomMapTool : MapTool |
具有可嵌入控件的工具
1 | // Using the Visual Studio SDK templates, add a MapTool and an EmbeddableControl |
具有可嵌入叠加控件的工具
1 | // Using the Visual Studio SDK templates, add a MapTool and an EmbeddableControl |
共享
ArcGIS 项目管理器:获取当前活动门户
1 | var active_portal = ArcGISPortalManager.Current.GetActivePortal(); |
ArcGIS 项目管理器:获取所有门户的列表
1 | var portals = ArcGISPortalManager.Current.GetPortals(); |
ArcGIS 项目管理器:将门户添加到门户列表
1 | var portalUri = new Uri("http://myportal.esri.com/portal/", UriKind.Absolute); |
ArcGIS 项目管理器:获取门户并登录,将其设置为活动状态
1 | //Find the portal to sign in with using its Uri... |
ArcGIS 程序管理器:侦听门户事件
1 | ArcGIS.Desktop.Core.Events.ActivePortalChangedEvent.Subscribe((args) => |
门户:从活动门户获取当前登录用户
1 | var portal = ArcGISPortalManager.Current.GetActivePortal(); |
门户:获取当前用户的“联机”门户视图
1 | //If no-one is signed in, this will be the default view for |
门户:获取当前用户的组织 ID
1 | var portal = ArcGISPortalManager.Current.GetPortal(new Uri(portalUri)); |
门户:从活动门户获取活动用户的用户内容
1 | var portal = ArcGISPortalManager.Current.GetActivePortal(); |
门户:下载用户内容中的任何包项
1 | //user content previously from... |
门户:获取指定用户的组
1 | //elsewhere... |
门户:执行门户搜索
1 | var portal = ArcGISPortalManager.Current.GetPortal(portalUri); |
EsriHttpClient:获取当前登录用户
1 | //Reference Newtonsoft - Json.Net |
获取当前登录用户的组
1 | //Assume that you have executed the "Get the Current signed on User" snippet and have 'userName' |
EsriHttpClient:查询活动门户上的 Esri 内容
1 | //http://www.arcgis.com/sharing/search?q=owner:esri&f=json |
EsriHttpClient:获取当前用户的 web 地图并将其添加到专业版
1 | UriBuilder searchURL = new UriBuilder(ArcGISPortalManager.Current.GetActivePortal().PortalUri) |
EsriHttpClient:获取服务图层并将其添加到专业版
1 | UriBuilder searchURL = new UriBuilder(ArcGISPortalManager.Current.GetActivePortal().PortalUri) |
公共设施网络
获取公共设施网络
从表中获取公共设施网络
1 | public static UtilityNetwork GetUtilityNetworkFromTable(Table table) |
从图层获取公共设施网络
1 | // This routine obtains a utility network from a FeatureLayer, SubtypeGroupLayer, or UtilityNetworkLayer |
元素
从元素中获取行
1 | // usage : using (var row = FetchRowFromElement(...)) |
编辑关联
创建公共设施网络关联
1 | // Create edit operation |
在单个编辑操作中创建公共设施网络要素和关联
1 | // Create an EditOperation |
遍历关联
获取向下遍历产生的遍历关联
1 | public static void GetTraverseAssociationsResultFromDownwardTraversal(UtilityNetwork utilityNetwork, IReadOnlyList<Element> startingElements) |
获取具有深度限制的向上遍历产生的遍历关联
1 | public static void GetTraverseAssociationsResultFromUpwardTraversalWithDepthLimit(UtilityNetwork utilityNetwork, IReadOnlyList<Element> startingElements) |
子网和层
查找给定域网络名称和层名称的层
1 | using (UtilityNetworkDefinition utilityNetworkDefinition = utilityNetwork.GetDefinition()) |
更新层中的所有脏子网
1 | using (SubnetworkManager subnetworkManager = utilityNetwork.GetSubnetworkManager()) |
具有一个控制器的简单径向子网的生命周期
1 | // Create a subnetwork named "Radial1" with a single controller |
具有多个控制器的网格子网的生命周期
1 | // Create a subnetwork named "Mesh1" from three controllers |
具有两个控制器的重馈径向子网的生命周期
1 | // Create a subnetwork named "R2, R3" from two controllers |
描图
创建下游跟踪程序
1 | using (TraceManager traceManager = utilityNetwork.GetTraceManager()) |
创建跟踪参数
1 | IReadOnlyList<Element> startingPointList = new List<Element>(); |
创建条件以将网络属性与一组值进行比较
1 | // Create a NetworkAttribute object for the Lifecycle network attribute from the UtilityNetworkDefinition |
创建函数
1 | // Get a NetworkAttribute object for the Load network attribute from the UtilityNetworkDefinition |
创建功能屏障
1 | // Create a NetworkAttribute object for the Shape length network attribute from the UtilityNetworkDefinition |
创建输出条件
1 | // Create an output category to filter the trace results to only include |
创建传播器
1 | // Get a NetworkAttribute object for the Phases Normal attribute from the UtilityNetworkDefinition |
使用函数结果
1 | // Get the FunctionOutputResult from the trace results |
按名称获取命名跟踪配置
1 | private void GetNamedTraceConfigurationsByName(UtilityNetwork utilityNetwork, string configurationName) |
从公共设施网络图层获取指定追踪配置
1 | private void GetNamedTraceConfigurationsFromUtilityNetworkLayer(UtilityNetworkLayer utilityNetworkLayer) |
使用指定追踪配置追踪公共设施网络
1 | private void TraceUtilityNetworkUsingNamedTraceConfiguration(UtilityNetwork utilityNetwork, NamedTraceConfiguration namedTraceConfiguration, Element startElement) |
网络图
获取图管理器
1 | using (DiagramManager diagramManager = utilityNetwork.GetDiagramManager()) |
获取网络图
1 | using (DiagramManager diagramManager = utilityNetwork.GetDiagramManager()) |
获取具有不一致一致性状态的网络图列表
1 | public List<NetworkDiagram> GetInconsistentDiagrams(UtilityNetwork utilityNetwork) |
从网络逻辑示意图中打开逻辑示意图窗格
1 | // Create a diagram layer from a NetworkDiagram (myDiagram) |
从关系图层获取关系图
1 | public void GetDiagram(DiagramLayer diagramLayer) |
获取图表模板
1 | public void RetrieveDiagramTemplates(UtilityNetwork utilityNetwork) |
从逻辑示意图模板获取网络逻辑示意图
1 | public void GetNetworkDiagramFromDiagramTemplates(UtilityNetwork utilityNetwork) |
创建网络图
1 | public void CreateNetworkDiagram(UtilityNetwork utilityNetwork, IEnumerable<Guid> globalIDs) |
以 JSON 字符串形式获取网络逻辑示意图信息
1 | public void GetDiagramContent(UtilityNetwork utilityNetwork) |
获取图元素
1 | public void GetDiagramElements(MapView mapView, NetworkDiagram networkDiagram) |
获取逻辑示意图聚合
1 | public void GetDiagramAggregation(NetworkDiagram networkDiagram) |
查找一组公共设施网络行的逻辑示意图要素
1 | public void FindDiagramFeatures(NetworkDiagram diagram, List<Guid> globalIDs) |
查找一组逻辑示意图要素的公共设施网络行
1 | public void FindDiagramRows(NetworkDiagram diagram, List<Guid> globalIDs) |
查找用于创建网络逻辑示意图的初始网络行
1 | public void FindInitialNetworkRows(NetworkDiagram diagram) |
更改网络逻辑示意图的布局
1 | public void DiagramElementQueryResultAndNetworkDiagramSubsetClasses(Geodatabase geodatabase, DiagramManager diagramManager, string diagramName) |
编辑网络图
1 | public void EditDiagram(NetworkDiagram diagram, List<Guid> globalIDs) |
宗地结构
获取活动记录
1 | string errorMessage = await QueuedTask.Run(() => |
设置活动记录
1 | string errorMessage = await QueuedTask.Run(async () => |
创建新记录
1 | string errorMessage = await QueuedTask.Run(async () => |
将标准线要素复制到宗地类型
1 | string errorMessage = await QueuedTask.Run( async () => |
将宗地行复制到宗地类型
1 | string errorMessage = await QueuedTask.Run( async () => |
将要素分配给活动记录
1 | string errorMessage = await QueuedTask.Run( () => |
创建宗地种子
1 | try |
构建宗地
1 | try |
重复的包裹
1 | var myParcelFabricLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<ParcelLayer>().FirstOrDefault(); |
设置历史宗地
1 | string errorMessage = await QueuedTask.Run(async () => |
将包裹收缩为种子
1 | string errorMessage = await QueuedTask.Run(async () => |
更改宗地类型
1 | //add polygon layers and the feature ids to change the type on to a new Dictionary |
获取宗地要素
1 | string sReportResult = "Polygon Information --" + Environment.NewLine; |
从宗地图层获取宗地结构数据集控制器
1 | string errorMessage = await QueuedTask.Run(() => |
获取宗地结构数据集的宗地拓扑
1 | string errorMessage = await QueuedTask.Run(() => |
从宗地结构数据集中获取点、连接和记录要素类
1 | string errorMessage = await QueuedTask.Run(() => |
从宗地结构数据集获取宗地类型要素类
1 | string errorMessage = await QueuedTask.Run(() => |
从要素图层获取宗地类型名称
1 | private async Task<string> GetParcelTypeNameFromFeatureLayer(ParcelLayer myParcelFabricLayer, FeatureLayer featLayer, GeometryType geomType) |
从表中获取宗地结构
1 | public static ParcelFabric GetParcelFabricFromTable(Table table) |
光栅
在文件夹中打开栅格数据集
1 | // Create a FileSystemConnectionPath using the folder path. |
在地理数据库中打开栅格数据集
1 | // Create a FileGeodatabaseConnectionPath using the path to the gdb. Note: This can be a path to a .sde file. |
从栅格数据集获取栅格数据集定义
1 | await QueuedTask.Run(() => |
访问栅格数据集中的波段
1 | var count = rasterDataset.GetBandCount(); |
访问栅格属性表中的行
1 | var raster = MapView.Active.Map.GetLayersAsFlattenedList().OfType<RasterLayer>().FirstOrDefault(); |
创建栅格光标以循环访问栅格数据
1 | await QueuedTask.Run(() => |
使用像素块在栅格数据集中读取和写入像素
1 | await QueuedTask.Run(() => |
使用像素块处理像素
1 | await QueuedTask.Run(() => |
计算栅格统计数据
1 | //If a raster dataset has statistics, you can create a raster layer and get these statistics by accessing the colorizer. |
场景图层
创建场景图层
1 | var sceneLayerUrl = @"https://myportal.com/server/rest/services/Hosted/SceneLayerServiceName/SceneServer"; |
建筑领域场景图层
获取建筑规程场景图层规程
1 | var bsl_discipline = MapView.Active.Map.GetLayersAsFlattenedList().OfType<BuildingDisciplineSceneLayer>().FirstOrDefault(l => l.Name == "Architectural"); |
枚举建筑物场景图层中的领域图层
1 | public void QueryBuildingSceneLayer() |
建筑物场景图层
建筑物场景图层的名称
1 | var bsl = MapView.Active.Map.GetLayersAsFlattenedList() |
查询建筑物场景图层以获取可用的类型和值
1 | //Must be called on the MCT |
创建默认筛选器并获取筛选器计数
1 | //Must be called on the MCT |
获取包含线框块的所有过滤器
1 | //var bsl = ...; |
设置和清除建筑物场景图层的活动过滤器
1 | //Must be called on the MCT |
获取建筑物场景图层过滤器 ID 和过滤器
1 | string filterID1 = filter1.ID; |
修改建筑物场景图层过滤器名称和描述
1 | //Must be called on the MCT |
使用建筑物标高和类别创建过滤器
1 | //Must be called on the MCT |
修改建筑物场景图层过滤器块
1 | //Must be called on the MCT |
移除建筑物场景图层过滤器
1 | //var bsl = ...; |
要素场景图层编辑
确定要素场景图层是否支持编辑
1 | var featSceneLayer = MapView.Active.Map.GetLayersAsFlattenedList() |
在要素场景图层中创建新点要素
1 | //must support editing! |
删除要素场景图层中的所有选定要素
1 | //must support editing! |
编辑要素场景图层的属性
1 | //must support editing! |
要素场景图层
要素场景图层的名称
1 | var featSceneLayer = MapView.Active.Map.GetLayersAsFlattenedList() |
获取数据源类型
1 | //Must be called on the MCT |
获取关联的要素类
1 | //var featSceneLayer = ....; |
获取字段定义
1 | //var featSceneLayer = ....; |
设置定义查询
1 | //Must be called on the MCT |
通过地图视图选择要素
1 | //assume the geometry used in SelectFeaturesEx() is coming from a |
具有关联的要素服务
1 | var featSceneLayer = MapView.Active.Map.GetLayersAsFlattenedList() |
搜索要素场景图层上的行
1 | //var featSceneLayer = ...; |
隐藏所选要素和显示隐藏要素
1 | //var featSceneLayer = ...; |
使用 MapView Select SelectFeaturesEx 或 GetFeaturesEx
1 | //var featSceneLayer = ...; |
对空间查询使用选择或搜索
1 | //var featSceneLayer = ...; |
点云场景图层
点云场景图层的名称
1 | var pcsl = MapView.Active.Map.GetLayersAsFlattenedList() |
获取点云场景图层的数据源类型
1 | //var pcsl = ...; |
查询点云场景图层中的所有类代码和标签
1 | //Must be called on the MCT |
为点云场景图层设置过滤器
1 | //Must be called on the MCT |
更新 PointCloudSceneLayer 的类标志
1 | //Must be called on the MCT |
获取 PointCloudSceneLayer 的过滤器
1 | //Must be called on the MCT |
清除点云场景图层中的过滤器
1 | //Must be called on the MCT |
获取点云场景图层渲染器和渲染器类型
1 | //Must be called on the MCT |
查询点云场景图层渲染器字段
1 | //Must be called on the MCT |
创建和设置拉伸渲染器
1 | //Must be called on the MCT |
创建和设置分类间隔渲染器
1 | //Must be called on the MCT |
点云场景图层扩展属性
编辑颜色调制
1 | //Must be called on the MCT |
编辑渲染器以使用固定大小
1 | //Must be called on the MCT |
编辑渲染器以缩放大小
1 | //Must be called on the MCT |
编辑密度设置
1 | //Must be called on the MCT |
流图层
创建流图层
使用 URI 创建流图层
1 | //Must be on the QueuedTask |
使用定义查询创建流图层
1 | //Must be on the QueuedTask |
使用简单渲染器创建流图层
1 | var url = @"https://geoeventsample1.esri.com:6443/arcgis/rest/services/LABus/StreamServer"; |
为最新观测值设置唯一值渲染器
1 | var url = @"https://geoeventsample1.esri.com:6443/arcgis/rest/services/AirportTraffics/StreamServer"; |
流图层设置和属性
查找所有可识别轨迹的流图层
1 | var trackAwareLayers = MapView.Active.Map.GetLayersAsFlattenedList() |
确定流图层类型
1 | //spatial or non-spatial? |
检查流图层连接状态
1 | if (!streamLayer.IsStreamingConnectionOpen) |
开始和停止流式传输
1 | //Must be on QueuedTask! |
删除所有当前和以前的观察结果
1 | //Must be on QueuedTask! |
获取跟踪 ID 字段
1 | if (streamLayer.IsTrackAware) |
获取曲目类型
1 | var trackType = streamLayer.TrackType; |
设置要存储在内存中的先前观测值的最大计数
1 | //Must be on QueuedTask |
设置要存储在内存中的先前观测值的最长期限
1 | //Must be on QueuedTask |
通过 CIM 设置各种流图层属性
1 | //The layer must be track aware and spatial |
渲染
定义唯一值呈现器定义
1 | var uvrDef = new UniqueValueRendererDefinition() |
为最新观测值设置唯一值渲染器
1 | //Define the classes by hand to avoid using CreateRenderer(...) |
为先前的观测值设置唯一值渲染器
1 | //The layer must be track aware and spatial |
设置简单的渲染器以绘制轨迹线
1 | //The layer must be track aware and spatial |
检查先前的观测值和轨道线可见性
1 | //The layer must be track aware and spatial for these settings |
使轨迹线和先前的观测点可见
1 | //The layer must be track aware and spatial for these settings |
检索当前观测渲染器
1 | //Must be on QueuedTask! |
检索上一个观测渲染器
1 | //The layer must be track aware and spatial |
检索轨迹线渲染器
1 | //The layer must be track aware and spatial |
订阅和搜索
搜索和订阅流数据
1 | await QueuedTask.Run(async () => |
搜索和订阅取消
1 | await QueuedTask.Run(async () => |
显式取消等待行异步
1 | //somewhere in our code we create a CancellationTokenSource |
实时要素类
从实时数据存储连接到实时要素类
1 | var url = "https://geoeventsample1.esri.com:6443/arcgis/rest/services/AirportTraffics/StreamServer"; |
检查实时要素类是否可识别轨迹
1 | using (var rfc = streamLayer.GetFeatureClass()) |
从实时要素类获取追踪 ID 字段
1 | //Must be on QueuedTask |
订阅流数据
1 | //Note: with feature class we can also use a System Task to subscribe and |
搜索现有数据并订阅流数据
1 | //Note we can use System Task with the Realtime feature class |
搜索和订阅取消
1 | await System.Threading.Tasks.Task.Run(async () => |
任务
检索项目中的所有任务项
1 | IEnumerable<TaskProjectItem> taskItems = Project.Current.GetItems<TaskProjectItem>(); |
打开任务文件 - .esriTasks 文件
1 | // Open a task file |
打开项目任务项
1 | // get the first project task item |
关闭任务项
1 | // find the first project task item which is open |
导出任务项
1 | // get the first project task item |
获取任务信息 - 从任务项目项
1 | var taskItem = Project.Current.GetItems<TaskProjectItem>().FirstOrDefault(); |
获取任务信息 - 从 .esriTasks 文件
1 | // TODO - substitute your own .esriTasks file |
在任务文件中打开特定任务 - .esriTasks 文件
1 | // TODO - substitute your own .esriTasks file to be opened |
订阅任务事件
1 | public void TaskEvents() |
工作流管理器
如何获取管理器对象
1 | // WorkflowModule.GetManager returns a manager of the type specified |
如何获取群组
1 | // GetAllGroups returns a list of Workflow Manager groups |
如何获取用户
1 | // GetAllUsers returns a list of Workflow Manager users |
如何获取作业类型
1 | // GetVisibleJobTypes returns a list of job types |
如何创建作业
1 | // CreateJob returns an ID of a new job |
如何找到工作
1 | // GetJob returns an existing job |
如何获取与地图关联的作业
1 | // Get a job associated with the map |
如何关闭作业
1 | // CloseJobs returns a list of closed job IDs |
如何访问和更改工作信息
1 | // You can change many of the exposed properties of a job and then save them |
如何在作业上执行步骤
1 | // Gets the current step |
如何执行查询
1 | // ExecuteQuery returns a query result |
);
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 WineMonk!
评论