ArcGIS Pro SDK 编辑
编辑
编辑操作方法
编辑操作创建要素
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 属性必须存在
旋转或移动批注
更改批注文本图形
公共设施网络
创建公共设施网络关联
在单个编辑操作中创建公共设施网络要素和关联
tion)
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 WineMonk!
评论