Infrastructure Map Server Forum
Welcome to Autodesk’s Infrastructure Map Server Forums. Share your knowledge, ask questions, and explore popular Infrastructure Map Server topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AddFeatures to selection from oracle

0 REPLIES 0
Reply
Message 1 of 1
t_suja
279 Views, 0 Replies

AddFeatures to selection from oracle

Below is my code to get features to a feature reader and then to add it to a selection. The below code works for SDF data but not for features coming from an oracle connection. I haven't tested for other connections. Am I missing something?

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
string selectionXML="";
MgMap map = new MgMap();
map.Open(resService, MapName);

MgLayerBase layer = map.GetLayers().GetItem(LayerName); string layerClassname = layer.GetFeatureClassName();
MgResourceIdentifier resId = new MgResourceIdentifierlayer.GetFeatureSourceId());

string QueryString;
MgSelection selection = new MgSelection(map);

for (int j = 0; j < fSel.Count; j++)
{

QueryString = fSel.ToString();
MgFeatureQueryOptions QueryOption = new MgFeatureQueryOptions();
QueryOption.SetFilter(QueryString);
MgFeatureReader featureReader = featureService.SelectFeatures(resId, layerClassname, QueryOption);

//nothing is added to the selection in the below line although the feature reader
// has records (Verified) and this happens only for the data coming from oracle
//I have also replaced fsel.count with 0, but doesn't seem to have an effect.
selection.AddFeatures(layer, featureReader, fSel.Count);

}

selectionXML = selection.ToXml();
return selectionXML;

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Can someone point me what might go wrong here?

Thanks,
Suja
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report