zoukankan      html  css  js  c++  java
  • 从MapX到MapXtreme2004[7]对Table、Feature等的理解

    一、Table
            2004中,Table还是表,可以来自原始的mapinfo表,也可以来自数据库的二维表、文本等。Table的等价概念是feature集合,如下代码:
            (_tempTable as IFeatureCollection).Clear();
            当然,可以通过枚举器,来逐个访问table的行,如下:
             Selection sl =MapInfo.Engine.Session.Current.Selections.DefaultSelection;
             IResultSetFeatureCollection fc=sl[0];        
             IFeatureEnumerator fn=fc.GetFeatureEnumerator();        //IFeatureCollection也有GetFeatureEnumerator
             ListBox1.Items.Clear();
             while(fn.MoveNext())
                if(fn.Current.Geometry.GetType().ToString()=="MapInfo.Geometry.LegacyText")
                     ListBox1.Items.Add(((MapInfo.Geometry.LegacyText)fn.Current.Geometry).Caption);
            当然,用
                    foreach(Feature feature in tb)
            也是毫无问题的,因而,table和结果集是等价的。   
    二、Feature
            Feature等价于表中的行。只与行有关,而与具体的图元的类型无关。换言之,Feature只是指图元对应的表行,而与图元的属性无关。
            用Feature.Table可以引用到所属的表。
            用Table.TableInfo可以引用到表的结构信息。
            Feature具有的默认列,一般都包括obj,Mi_key,Mi_Style。obj我个人认为就是Feature对应的几何对象。用Feature.Geometry属性可以引用。
            Feature.Geometry的类型是FeatureGeometry,它是各种具体图元(点线面文字...)的父类,Feature.Geometry属性所对应的,其实是具体的类。(我向这个属性赋点对象,发现没错)。
            对Feature的使用,可以通过CataLog的SearchForFeature来查找,如下
                MapInfo.Engine.Session.Current.Catalog.SearchForFeature("Layer1",MapInfo.Data.SearchInfoFactory.SearchWhere("MI_Key='"+strKey+"'") ) 
            由于ID其实并不唯一,所以,较好的查找对象是MI_Key。同时,Catalog还有其他的查找函数,如SearchNearest等。
            加入Feature时,往往需要指定这些基本的信息,有多种加入方法,参见本系列的[5]。
  • 相关阅读:
    青浦图书志
    师徒俩就这样比划着 讲着该怎么去使用Reactor Programming
    Stephane Maldini and Violeta Georgieva at SpringOne Platform 2019
    reactor 大会
    这样使用Mono.zip就可以合并多个值进行下一步运算
    You are totally right 和 You are absolutely right 区别
    reacctor 1
    developer.ibm.com
    zip~~~~~~~~~~~
    044 01 Android 零基础入门 01 Java基础语法 05 Java流程控制之循环结构 06 使用do-while循环实现猜字游戏
  • 原文地址:https://www.cnblogs.com/jetz/p/200414.html
Copyright © 2011-2022 走看看