Engine加载服务后如何对图层进行查询?

加载地图服务到mapcontrol中显示,之后如何查询这个REST服务图层的空间数据?
已邀请:

刘峥 - ArcGIS多面手

赞同来自:

【解决办法】:
通过图层无法查询,还是需要通过mapserver,如: 


IAGSServerObjectName pSOName = null; 
IAGSServerObjectName psoname = null; 
IAGSServerConnection con = new AGSServerConnection(); 
IAGSServerConnectionFactory2 confactory = new AGSServerConnectionFactory() as IAGSServerConnectionFactory2; 
IPropertySet propertyset = new PropertySet(); 
IMapServerLayer mapserverlayer = new MapServerLayerClass(); 

propertyset.SetProperty(URL, http://192.168.100.139:6080/arcgis/rest/services); 
con = confactory.Open(propertyset, 0); 

IAGSEnumServerObjectName enumSOName = con.ServerObjectNames; 


pSOName = enumSOName.Next(); 
while (pSOName != null) 

if (pSOName.Name == svName) 

psoname = pSOName; 
break; 

pSOName = enumSOName.Next(); 

IName pName = psoname as IName; 
IMapServer mapserver = pName.Open() as IMapServer; 
mapserverlayer.ServerConnect(pSOName, mapserver.DefaultMapName); 
axMapControl1.AddLayer(mapserverlayer as ILayer); 

IQueryFilter qf = new QueryFilterClass(); 
qf.WhereClause = FID < 800; 
IRecordSet recordSet = mapserver.QueryFeatureData(mapserver.DefaultMapName, 0, qf);

要回复问题请先登录注册