内容摘要 | |||||
在AO中可以将一个带有X Y 坐标的数据库表作为 点状图层加载 此方法可用于通过数据库更新的方式 保持数据同步的情况 |
|||||
过程描述 | |||||
private IFeatureClass OpenXYData(ITable t,string xname,string yname,string zname) { // xy字段属性描述 IXYEvent2FieldsProperties xyp =new XYEvent2FieldsPropertiesClass (); xyp.XFieldName = xname; xyp.YFieldName = yname; xyp.ZFieldName = zname; //XY事件 数据表名称描述 IXYEventSourceName srcname = new XYEventSourceNameClass(); srcname.EventProperties = xyp; IDataset ds =t as IDataset; IName tname = ds.FullName; //srcname.SpatialReference = MapCtr.Map.SpatialReference ; srcname.EventTableName = tname; IName xyname=srcname as IName; IXYEventSource xysrc = (IXYEventSource) xyname.Open(); return xysrc as IFeatureClass; } |