Engine或者ArcObjects中可否获取地图服务所对应数据源的属性表?

Engine或者ArcObjects中可否获取地图服务所对应数据源的属性表?
已邀请:

朱新颖

赞同来自:

【解决办法】:
可以,通过IMapServer.QueryFeatureData()方法,获取IRecordSet,然后通过其Table属性获取ITable。


IAGSServerObjectName3 pSOName = null;
IAGSServerObjectName3 psoname = null;
IAGSServerConnection con = null;// new AGSServerConnection();
IAGSServerConnectionFactory2 confactory = new AGSServerConnectionFactory() as IAGSServerConnectionFactory2;
IPropertySet propertyset = new PropertySet();

propertyset.SetProperty(URL, http://localhost:6080/arcgis/rest/services);

con = confactory.Open(propertyset, 0);
IAGSEnumServerObjectName enumSOName = con.ServerObjectNames;

pSOName = (IAGSServerObjectName3)enumSOName.Next();
while (pSOName != null)
{
if ((pSOName.Type == MapServer) && (pSOName.Name == China_mapService))
{
psoname = pSOName;
break;
}
pSOName = (IAGSServerObjectName3)enumSOName.Next();
}
IName pName = psoname as IName;
IMapServer mapserver = pName.Open() as IMapServer;
string name = mapserver.DefaultMapName;


IRecordSet recordSet = mapserver.QueryFeatureData(mapserver.DefaultMapName, 0, null);
ITable table = recordSet.Table;


要回复问题请先登录注册