ArcGIS Engine二次开发普通表关联到地图属性表

时间:2014-1-21    作者:悬浮的青春    分类: gis二次开发



//通过join关联外部表

IMap  pMap=AxMapControl1.Map;

ILayer  pLayer=pMap.layer(0);

IFeatureLayer  pFLayer=( IFeatureLayer) pLayer;

IFeatureClass  pFeatureClass=pFLayer.FeatureClass;

IMemoryRelationshipClassFactory  pMemoRelCFactory=new MemoryRelationshipClassFactoryClass();

IRelationshipClass  pRelationshipClass = pMemoRelCFactory.Open (“TableJoin1”,pFClass,”OBJECTID”,(IObjectClass)pForeignTable,  ”OBJECTID”,  ”forward”,  ”backward”, esriRelCardinality.esriRelCardinalityOneToOne);

IDisplayRelationshipClass  pDisplayRelationshipClass=( IDisplayRelationshipClass)pFlayer;

pDisplayRelationshipClass.DisplayRelationshipClass(pRelClass,esriJoinType.esriLeftOuterJoin); //左连接。

标签: arcgis

WRITTEN BY

avatar

推荐阅读: