AE基礎之新增點 線 面要素

2021-09-01 19:31:23 字數 1642 閱讀 5653

事先定義pmap和pactiveview物件

imap pmap = axmapcontrol1.map;

iactiveview pactview = axmapcontrol1.activeview;

點要素tian新增

1、在mapcontrol1的mouse事件中新增如下**

axmapcontrol1.mousepointer = esricontrolsmousepointer.esripointercrosshair;

imarkerelement markerelement = new markerelementclass();

ielement element = markerelement as ielement;

element.geometry = pt;

igraphicscontainer graphicscontainer = pmap as igraphicscontainer;

graphicscontainer.addelement((ielement)markerelement, 0);

pactview.refresh();

2、在點要素單擊事件按鈕中呼叫以上**

線要素新增

1、在mapcontrol1的mouse事件中新增如下**

axmapcontrol1.mousepointer = esricontrolsmousepointer.esripointercrosshair;

igeometry polyline = axmapcontrol1.trackline();

ilineelement plele = new lineelementclass();

ielement pele = plele as ielement;

pele.geometry = polyline;

igraphicscontainer pgracontainer = pmap as igraphicscontainer;

pgracontainer.addelement((ielement)plele, 0);

pactview.refresh();

面要素新增

1、在mapcontrol1的mouse事件中新增如下**

axmapcontrol1.mousepointer = esricontrolsmousepointer.esripointercrosshair;

igeometry poly = axmapcontrol1.trackpolygon();

ipolygonelement polygonele = new polygonelementclass();

ielement pelement = polygonele as ielement;

pelement.geometry = poly;

igraphicscontainer pgraphicscontainer = pmap as igraphicscontainer;

pgraphicscontainer.addelement((ielement)polygonele, 0);

pactview.refresh();

2、在面要素單擊事件按鈕中呼叫以上**

使用ArcObjects新增點線面

在ae中資料編輯是乙個重難點。它包括的東西很多,如地物的新增,地物的修改,地物查詢,節點捕捉,地物的符號化等一系列的問題。熟練的使用地物編輯的功能,是開發乙個系統必須具備的條件。資料編輯問題解決得好壞直接決定著軟體是否操作方便。在這我只是寫一些相應的功能函式,至於軟體開發中的架構暫不考慮。1 新增地...

ArcGIS Engine中新增點 線 面元素

原文arcgis engine中新增點 線 面元素 畫點 imarkerelement pmarkerelement new markerelementclass ielement pelement pmarkerelement as ielement pelement.geometry pt ig...

POSTGIS建表,增加點線面

1 建線表,插入線 set client encoding to utf8 set standard conforming strings to on begin create table test2 gid serial,field2 varchar 254 alter table test2 a...