ArcEngine 面要素類轉點

2021-07-29 20:25:02 字數 1338 閱讀 8472

雖然有方便的gp工具featureverticestopoint。然而其需要最高許可權,某些時候沒法使用,可以用下面的函式作為替代。

[csharp]view plain

copy

/// 

/// 要素節點轉點

/// 

/// 要轉換的要素類

/// 要生成轉換後要素類的要素資料集

/// 生成的點要素類

private

ifeatureclass prv_featureverticestopoints(ifeatureclass in_featureclass,ifeaturedataset in_featuredataset)  

temp_eachfeature = temp_geteachfeature.nextfeature();  

}  temp_featurecursor.flush();  

temp_workspaceedit.stopeditoperation();  

temp_workspaceedit.stopediting(true

);  

//清理資源並返回

system.runtime.interopservices.marshal.releasecomobject(temp_geteachfeature);  

}  return

temp_vpfeatureclass;  

}  

該函式的輔助函式

[csharp]view plain

copy

private

ifields prv_setfields(ifeatureclass in_featureclass)

//設字段的函式  

經測試,該方法只在

資料量小時起作用,資料量過大會出錯

(本人測試32000個面轉到15000個面就報錯了)

效率遠遠低於gp工具

。估計gp工具採取了某些底層演算法,處理60萬點在160秒內(i5-6500,8g),本函式處理15000個面也需要超過10分鐘時間。

如果有好方法也可以分享一下。

附gp工具的函式:

[csharp]view plain

copy

//面轉節點(gp法)

private

ifeatureclass prv_featureverticestopoints_gp(ifeatureclass in_featureclass,ifeaturedataset fds_mainfeaturedataset)  

Arcengine合併面要素

問題 對兩個進行合併的過程中 比如面a和麵b 發現無論怎麼合併最後的結果總是a要素的區域。解決方法 使用itopologicaloperator.union 方法對a b倆個面要素進行合併,後來發現是沒有獲取union操作的結果 當時的錯誤 是這樣的 itopologicaloperator2 un...

複製要素類到新的要素類ArcEngine

前提 複製要素類之間欄位要保證一致 複製要素 源要素,即要複製的要素 目標要素 public void insertfeaturesusingcursor ifeatureclass sourcefeatureclass,ifeatureclass targetfeatureclass 如果是線或面...

ArcEngine資料編輯 選擇要素

原文arcengine資料編輯 選擇要素 要編輯要素,首先要選中要素,按shift鍵進行多選,按esc鍵清空選擇。個人了解的選擇高亮顯示有兩種方式,都是在public override void onmousedown int button,int shift,int x,int y 事件中處理實現...