I am trying to intersect a geometry with a feature class to get the intersected features with this geometry.
but i get this error:"
Underlying DBMS error[ORA-29902: error in executing ODCIIndexStart() routine
ORA-28578: protocol error during callback from an external procedure
ORA-06512: at "SDE.ST_GEOMETRY_SHAPELIB_PKG", line 870
ORA-06512: at "SDE.SPX_UTIL", line 2914
ORA-06512: at "SDE.SPX_UTIL", line 3194
ORA-06512: at "SDE.ST_DOMAIN_METHODS", line 299
"
at this line: ESRI.ArcGIS.Geodatabase.IFeature feature = featureCursor.NextFeature();
Here is the code:
public static List<ESRI.ArcGIS.Geodatabase.IFeature> PerformSpatialQuery(ESRI.ArcGIS.Geometry.IGeometry
geometryToSearchBy, ESRI.ArcGIS.Geodatabase.esriSpatialRelEnum spatialRel, ESRI.ArcGIS.Geodatabase.IFeatureClass
featureClassToSearchIn, string subFields)
{
List<ESRI.ArcGIS.Geodatabase.IFeature> featuresLst = null;
try
{
if (geometryToSearchBy != null && !geometryToSearchBy.IsEmpty && subFields != "" && featureClassToSearchIn
!= null)
{
ESRI.ArcGIS.Geodatabase.ISpatialFilter spatialFilter = new ESRI.ArcGIS.Geodatabase.SpatialFilterClass
();
spatialFilter.Geometry = geometryToSearchBy;
spatialFilter.SpatialRel = spatialRel;
spatialFilter.SubFields = subFields;
ESRI.ArcGIS.Geodatabase.IFeatureCursor featureCursor = featureClassToSearchIn.Search(spatialFilter,
false);
featuresLst = new List<ESRI.ArcGIS.Geodatabase.IFeature>();
ESRI.ArcGIS.Geodatabase.IFeature feature = featureCursor.NextFeature();
while (feature != null)
{
featuresLst.Add(feature);
feature = featureCursor.NextFeature();
}
}
return featuresLst;
}
catch (Exception ex)
{
Logger.LoggerInstance.LogError(ex.Message, DateTime.Now, "PerformSpatialQuery", "SpatialOperations", "");
throw new Exception(ex.Message);
}
}
There could be several reasons for the error you are getting. One of the causes of this error has to do with the schema of the feature class that's passed in. By this, I mean the field names.
Try and pass in a null string for the subFields parameter in your PerformSpatialQuery() method, and see if this resolves the error.
See this Web page in the ArcObjects Online Help:
IQueryFilter.SubFields Property
http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//0025000006n4000000
Hello,
I am getting a similar error message in the Search method while doing spatial query in ArcObjects (C#). The code is given below.
public IFeatureCursor GetOSMMGeometry(IFeature pFeederFeature, IFeatureClass pOsmmFC, string osmm_FeatCodeList)
{
ISpatialFilter pSpatialFilter = null;
IFeatureCursor pOsmmCursor;
try
{
pSpatialFilter = new SpatialFilterClass();
pSpatialFilter.Geometry = pFeederFeature.ShapeCopy;
pSpatialFilter.GeometryField = pOsmmFC.ShapeFieldName;
pSpatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;
pSpatialFilter.WhereClause = "FEATCODE IN (" + osmm_FeatCodeList + ")";
pSpatialFilter.SubFields = "*";
pOsmmCursor = pOsmmFC.Search(pSpatialFilter, false);
return pOsmmCursor;
}
catch(Exception ex)
{
}
}
Exception details given below.