• 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);
    
            }
  • 相关阅读:
    转 Java中wait和sleep方法的区别
    linux 中常用安装配置
    php 图片压缩
    利用 jQuery-photoClip插件 实现移动端裁剪功能并以Blob对象上传
    phpStudy for Linux (lnmp+lamp一键安装包)
    js图片实现延迟加载
    杂项
    正则表达式
    sublime text 3 中 SFTP插件 的 配置
    如何解决PHP生成UTF-8编码的CSV文件用Excel打开乱码的问题
  • 原文地址:https://www.cnblogs.com/gisoracle/p/12572604.html
Copyright © 2020-2023  润新知