ArcEngine資料編輯 選擇要素

2021-09-07 08:33:56 字數 2145 閱讀 4403

**原文arcengine資料編輯--選擇要素

要編輯要素,首先要選中要素,按shift鍵進行多選,按esc鍵清空選擇。

個人了解的選擇高亮顯示有兩種方式,都是在public override void onmousedown(int button, int shift, int x, int y)事件中處理實現:

1、  ifeatureselection 這個要求明確選擇的圖層

ienvelope penvelope;

double tol = 20

;penvelope =ppoint.envelope;

penvelope.width = penvelope.width +tol;

penvelope.height = penvelope.height +tol;

penvelope.centerat(ppoint);

ispatialfilter pspatialfilter;

pspatialfilter = new

spatialfilterclass();

pspatialfilter.geometry =penvelope;

pspatialfilter.spatialrel =esrispatialrelenum.esrispatialrelintersects;

ifeatureselection pfeatureselection;

pfeatureselection = ucdrawpanel.currentfeaturelayer as

ifeatureselection;

ifeature pfeature;

ucdrawpanel.unionfeature = new list();//

例項化合併要素集

if (shift == 1)}

else

pactiveview.partialrefresh(esriviewdrawphase.esriviewgeoselection, ucdrawpanel.currentfeaturelayer,

null

);//

高亮顯示出來

i******fillsymbol ifillsymbol;

isymbol isymbol;

irgbcolor irgbcolor;

ifillsymbol = new

******fillsymbol();

ifillsymbol.style =esri******fillstyle.esrisfssolid;

irgbcolor = new

rgbcolor();

irgbcolor.green = 128

;ifillsymbol.color =irgbcolor;

isymbol =(isymbol)ifillsymbol;

isymbol.rop2 =esrirasteropcode.esriropnotxorpen;

ienumfeature penumfeature = pactiveview.focusmap.featureselection as

ienumfeature;

penumfeature.reset();

pfeature =penumfeature.next();

//選中要素高亮顯示

if (pfeature != null

) ucdrawpanel.currentfeature = ucdrawpanel.unionfeature[ucdrawpanel.unionfeature.count - 1

]; _mapctrl.flashshape(pgeometry,

1, 500

, isymbol);}//

清空選擇要素

else

2、  selectbymap 基於整個地圖,當然也可以先將圖層的selectable屬性動態設定下

if (button == 1

)

else

}

ps:esc鍵退出,在onkeydown事件中實現

public

override

void onkeydown(int keycode, int

shift)

}

ArcEngine面資料漸變渲染

arcengine 面資料漸變渲染 說明,以下 實現依據 shp中的 wql和 vol欄位的值對面進行漸變色渲染。程式主要 如下 需要新增的引用 using esri.arcgis.display using esri.arcgis.carto using esri.arcgis.geodataba...

ArcEngine資料刪除幾種方法

一 幾種刪除方法 1.查詢結果中刪除 private void delete1 ifeatureclass pfeatureclass system.runtime.interopservices.marshal.releasecomobject pqueryfilter 2.更新游標刪除 priv...

ArcEngine 幾何資料檢查與修復

主要用到的類是gp工具及兩個工具類 checkgeometry 和 repairgeometry var geoprocessor new geoprocessor var checkgeometrytool new checkgeometry var repairgeometrytool new ...