mapxtreme c 實戰摘要 一

2021-04-02 02:48:34 字數 2793 閱讀 7239

ppp80近日用了一下mapxtreme for .net。雖然感覺沒有mapx的好用,不過這

個可以和.net結合,已經很滿足了。不過我的程式只用了一點點mapxtreme的

東西,所以發掘的東西很少,先記在下邊:

1建立臨時層

mapinfo.data.tableinfomemtable tblinfotemp = new mapinfo.data.tableinfomemtable("animation");

mapinfo.data.table tbltemp = cat.gettable("animation");

if (tbltemp != null)     

tblinfotemp.columns.add(mapinfo.data.columnfactory.createfeaturegeometrycolumn(mapcontrol1.map.getdisplaycoordsys()));

tblinfotemp.columns.add(mapinfo.data.columnfactory.createstylecolumn());

tblinfotemp.columns.add(mapinfo.data.columnfactory.createstringcolumn("編號", 8));

tblinfotemp.columns.add(mapinfo.data.columnfactory.createstringcolumn("裝置編號", 8));

tbltemp = cat.createtable(tblinfotemp);

featurelayer lyr = new featurelayer(tbltemp);

mapcontrol1.map.layers.add(lyr);

2建立點樣式

mapinfo.styles.fontpointstyle _fontsymbol=new mapinfo.styles.fontpointstyle();

_fontsymbol.code=53;

_fontsymbol.pointsize=14;

_fontsymbol.color=system.drawing.color.purple;

_fontsymbol.font.name="map symbols";

_fontsymbol.font.fontweight=mapinfo.styles.fontweight.bold;

_fontsymbol.angle=ang;//因為是車,所以有一定角度的

3建立點

featuregeometry pt3 = new mapinfo.geometry.point(lyr.coordsys, new dpoint(x,y)) as featuregeometry;

mapinfo.styles.compositestyle cs3 = new mapinfo.styles.compositestyle(new mapinfo.styles.******vectorpointstyle(37, system.drawing.color.red, 10));

mapinfo.data.feature ftr3 = new mapinfo.data.feature(tbltemp.tableinfo.columns);

ftr3.geometry = pt3;

cs3.symbolstyle=_fontsymbol;

ftr3.style = cs3;

ftr3["編號"] = idr[0].tostring();

ftr3["裝置編號"] =idr[1].tostring();

。。。。

4為點新增標註

mapinfo.styles.textstyle _fontsymbol=new mapinfo.styles.textstyle();

_fontsymbol.font.forecolor=color.red;

_fontsymbol.font.size=8;

labellayer layer = new labellayer();

mapcontrol1.map.layers.add(layer);

labelsource source = new labelsource(cat.gettable("animation"));

source.defaultlabelproperties.caption = "temp";           

5清除所有的點

catalog cat = mapinfo.engine.session.current.catalog;

table tbltemp = cat.gettable("animation");

if (tbltemp != null)

tbltemp.endaccess ();

}6查詢點

feature fks = _catalog.searchforfeature("animation", mapinfo.data.searchinfofactory.searchwhere("編號='"+id+"'"));

searchinfo si = mapinfo.data.searchinfofactory.searchintersectsfeature(fks, intersecttype.geometry);

iresultsetfeaturecollection fc = _catalog.search("animation", si);

mapcontrol1.map.setview(fc.envelope);

_selection.clear();

_selection.add(fc);

7在datagrid中顯示圖層所有點

mapx vb實戰摘要(四)

ppp80上個月去天津 2004 做這個專案,加班加點忙乎過了十一,現在專案終 於完成了第一階段,可以閒下來總結一下了。在做這個專案之前我只是自學了一個月的supermap,不過感覺gis這些東 西都是大同小異,沒什莫可怕 關鍵比較鬱悶的是本來根本就是做.現 在卻要用vb實在太。算了,趕鴨子上架,不...

AI實戰 文字自動摘要簡述

分為無監督和有監督。大部分都是基於的seq2seq框架 neural headline generation with minimum risk training attention model attention based summarization abs abs recurrent atte...

《Effective C 》重點摘要(一)

這個星期不再發布關於資料結構的部落格,想把半個月來看的書做一些總結,整理整理,第一本就是 effective c 第一次看這本書是一年多前,準備考研複試的時候,隨後陸陸續續,這個月再來看算是第三遍了吧,之前沒有看過 深度探索c 物件模型 所以有的地方看得不是很透徹 現在有的地方也看得不透,但是比以前...

初學php摘要 一

1.通過php連結mysql資料庫 定義 變數 hello hello helloworld 輸出變數hello echo hello 連線資料庫 dbconnection mysql connect localhost root lin 選擇表單 mysql select db test 設定編碼...

Lua 一些小摘要(一)

一。lua的一些小語法 1.lua中每一條語句後沒有分號 2.string的定義可以用雙引號 也可以用單引號 3.宣告整形 age 100 字串宣告 name zxf 宣告bool flag false 4.變數的命名不能以數字開頭,儘量不要用下劃線加大寫字母開頭,推薦c 命名法 5.單行註釋 註釋...