计算一个多边形内点的数目(已完成)

2015-06-11 11:11:30  访问(1326) 赞(0) 踩(0)

Catalog catalog = Session.Current.Catalog;
            Table table = catalog.GetTable("polygontable");
            MapInfo.Mapping.FeatureLayer lyr = new MapInfo.Mapping.FeatureLayer(table);
            MapInfo.Data.SearchInfo si = MapInfo.Data.SearchInfoFactory.SearchWhere("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";
            command.Parameters.Add("@vb", feature.Geometry);
            command.Prepare();
            MapInfo.Data.IResultSetFeatureCollection irfc = command.ExecuteFeatureCollection();
            MessageBox.Show(irfc.Count.ToString());
            command.Dispose();
            connection.Close();
            irfc.Close();


标签:计算一个多边形内点的数目(已完成) 

上一条:

下一条:


 

相关评论

评论加载中……
 

发表评论

类型:
内容:
  (Alt+Enter)