zoukankan      html  css  js  c++  java
  • ArcGIS Pro批量线分割面,也可以线分割线

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using ArcGIS.Core.CIM;
    using ArcGIS.Core.Data;
    using ArcGIS.Core.Geometry;
    using ArcGIS.Desktop.Catalog;
    using ArcGIS.Desktop.Core;
    using ArcGIS.Desktop.Editing;
    using ArcGIS.Desktop.Extensions;
    using ArcGIS.Desktop.Framework;
    using ArcGIS.Desktop.Framework.Contracts;
    using ArcGIS.Desktop.Framework.Dialogs;
    using ArcGIS.Desktop.Framework.Threading.Tasks;
    using ArcGIS.Desktop.Mapping;
    
    namespace TKPrint
    {
        internal class MapTool1 : MapTool
        {
            public MapTool1()
            {
                IsSketchTool = true;
                SketchType = SketchGeometryType.Line;
                SketchOutputMode = SketchOutputMode.Map;
            }
    
            protected override Task OnToolActivateAsync(bool active)
            {
                return base.OnToolActivateAsync(active);
            }
    
            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.Cut(featureLayer, id, geometry);
      //deleteFeatures.Split(featureLayer, id, geometry); deleteFeatures.ExecuteAsync(); } }
    //deleteFeatures.Delete(selection); //Execute to execute the operation //Must be called within QueuedTask.Run }); return base.OnSketchCompleteAsync(geometry); } } }
  • 相关阅读:
    Linux 用户管理命令-usermod和chage
    用户管理命令-passwd
    Linux 用户管理命令-useradd
    用户和用户组管理-用户管理相关文件
    用户和用户组管理-组信息文件
    用户和用户组管理-影子文件shadow
    jQuery火箭图标返回顶部代码
    jQuery火箭图标返回顶部代码
    jQuery火箭图标返回顶部代码
    jQuery火箭图标返回顶部代码
  • 原文地址:https://www.cnblogs.com/gisoracle/p/12573039.html
Copyright © 2011-2022 走看看