raghuveer2803

AutomationException: 0x80004005 - error while quering overlapped features

Discussion created by raghuveer2803 on Jun 21, 2013
I am trying to get overlapped features of two feature classes (linear) .
Following is what i am trying

FeatureClass firstListFeatureClass = firstFeatureClass;  
FeatureClass secondListFeatureClass = secondFeatureClass;
    
IFeatureCursor featureCursor = firstListFeatureClass.search(null, false);
IFeature feature = featureCursor.nextFeature();
    
while(feature != null)
{     
IGeometry pGeom= feature.getShape();
SpatialFilter spf=new SpatialFilter();
spf.setGeometryByRef(pGeom);
int sprel_index=esriSpatialRelationEnum.esriSpatialRelationOverlap;
spf.setSpatialRel(sprel_index);
     
IFeatureCursor pfcursor=secondListFeatureClass.search(spf, false);
      
IFeature SecondFeature = pfcursor.nextFeature();
while(SecondFeature!=null)
{
int idValue = SecondFeature.getOID();
System.out.println("-----OID--"+idValue);
Secondfeature.getShape();
               
SecondFeature=pfcursor.nextFeature();
             }
     
          
feature = featureCursor.nextFeature();
}


While accessing "IFeature SecondFeature = pfcursor.nextFeature();" my console is showing error of

Error: AutomationException: Unspecified error
Sample failed.  Exiting...
AutomationException: 0x80004005 - Unspecified error

Can anybody specify whats the problem.

Outcomes