mapxtreme中 用多邊形選擇工具SelectPolygon 選定地圖后 會(huì)返回一個(gè) 選擇區(qū)域的圖層嗎
以什么樣方式 返回 是一個(gè)建立好的新圖層返回? 還是新圖元的形式返回? 如果自動(dòng)返回新圖
層“Polygontable”,那下面的代碼為什么提示table=null呢
?
Catalog catalog = Session.Current.Catalog;
Table table = catalog.GetTable("polygontable"); //這里出現(xiàn)錯(cuò)誤 table=null
MapInfo.Mapping.FeatureLayer lyr = new MapInfo.Mapping.FeatureLayer(table);
MapInfo.Data.SearchInfo si = MapInfo.Data.SearchInfoFactory.SearchWhere("Field1 = 'er' "); //這里的Field1=‘er’ 是代表選定的圖元嗎? 如果不是那代表什么?
MapInfo.Data.Feature feature = MapInfo.Engine.Session.Current.Catalog.SearchForFeature(lyr.Table, si);
MapInfo.Data.MIConnection connection = new MapInfo.Data.MIConnection();
connection.Open();
MapInfo.Data.MICommand command = connection.CreateCommand();
command.CommandText = "Select * from pointTable where PointTable.obj within @vb"; //這里VB又應(yīng)該用什么參數(shù)呢
command.Parameters.Add("@vb", feature.Geometry);
command.Prepare();
MapInfo.Data.IResultSetFeatureCollection irfc = command.ExecuteFeatureCollection();
System.Windows.Forms.MessageBox.Show(irfc.Count.ToString());
command.Dispose();
connection.Close();
irfc.Close();
2 ?Field1=‘er’ ?這是什么 field是表名 還是選定區(qū)域的返回的表名?
3 @vb應(yīng)該設(shè)置什么參數(shù)嗎
mapxtreme中 幾個(gè)小問(wèn)題?1用多邊形選擇工具SelectPolygon 選定地圖后 會(huì)返回一個(gè) 選擇區(qū)域的圖層嗎
桃花長(zhǎng)相依
2018-12-06 20:51:24