Feature相关程序:向地图中插入一个特殊的feature

2015-06-11 12:03:47  访问(1493) 赞(0) 踩(0)

public void Load_Table_Feature()
        {
            Table usa = Session.Current.Catalog["USA"];
            // 获得我们所需要的属性值           
 Columns schema = new Columns();
            schema.Add(usa.TableInfo.Columns["MI_Geometry"].Clone());
            schema.Add(usa.TableInfo.Columns["MI_Style"].Clone());
            schema.Add(usa.TableInfo.Columns["State"].Clone());
            schema.Add(usa.TableInfo.Columns["State_Name"].Clone());
            schema.Add(usa.TableInfo.Columns["Pop_1990"].Clone());
            // 创建一个关键字key
            Key key = new Key();
            Feature feature = null;
            key.Value = "20"; // 这是要检索的记录.
            feature = new Feature(usa, key, schema);
            // 刚创建了当feature的属性被访问时自动加载功能
            // 验证功能是否有效
            try
            {
                feature.Load();
                Console.Out.WriteLine("Feature identified by Key='" + feature.Key.ToString() + "' hass successfully been retrieved.");
            }
            catch (FeatureException ftrException)
            {
                Console.Out.WriteLine(ftrException.ToString());
            }
        }


标签:Feature相关程序:向地图中插入一个特殊的feature 

上一条:

下一条:


 

相关评论

评论加载中……
 

发表评论

类型:
内容:
  (Alt+Enter)