• ArcGIS Pro 删除选择范围的数据和批量裁剪clip


      protected override Task<bool> OnSketchCompleteAsync(Geometry geometry)
            {
                QueuedTask.Run(() =>
                {
                    var deleteFeatures = new EditOperation();
                    deleteFeatures.Name = "Delete Features";
                    Polygon polygon = geometry as Polygon;
    
                    //Delete all the selected features in the active view
                    //Select using a polygon (for example)
                    var selection = MapView.Active.SelectFeatures(polygon).Select(
                          k => new KeyValuePair<MapMember, List<long>>(k.Key as MapMember, k.Value));
    
                    deleteFeatures.Delete(selection);
    
                    //Execute to execute the operation
                    //Must be called within QueuedTask.Run
                    deleteFeatures.Execute();
                });
                return base.OnSketchCompleteAsync(geometry);
    
            }
      protected override Task<bool> OnSketchCompleteAsync(Geometry geometry)
            {
                QueuedTask.Run(() =>
                {
                  
                    
                    //Delete all the selected features in the active view
                    //Select using a polygon (for example)
                    var selection = MapView.Active.SelectFeatures(geometry).Select(
                          k => new KeyValuePair<MapMember, List<long>>(k.Key as MapMember, k.Value));
                    foreach (var a in selection)
                    {
                        Layer featureLayer = a.Key as Layer;
                        foreach (var id in a.Value)
                        {
                            var deleteFeatures = new EditOperation();
                            deleteFeatures.Name = "Delete Features";
    
                            deleteFeatures.ShowProgressor = true;
                            deleteFeatures.EditOperationType = EditOperationType.Long;
                            deleteFeatures.Clip(featureLayer, id, geometry);
                            deleteFeatures.ExecuteAsync();
                        }
                    }
                    //deleteFeatures.Delete(selection);
    
                    //Execute to execute the operation
                    //Must be called within QueuedTask.Run
                    
                });
                return base.OnSketchCompleteAsync(geometry);
    
            }
  • 相关阅读:
    第四章 利用函数实现指定的功能
    5-7 点到原点的距离(多态)
    5-2 宠物的生长(多态)
    5-7 学生cpp成绩统计
    5-6 学生CPP成绩计算
    php将远程图片下载保存到本地
    vs2010 调试快捷键
    vs2010 快捷键大全
    [C#] 使用Application.AddMessageFilter当做Form的热键
    C# 收发和处理自定义的WINDOWS消息
  • 原文地址:https://www.cnblogs.com/gisoracle/p/12572604.html
Copyright © 2020-2023  润新知