intersecting a geometry with a feature class error in SHAPELIB

3597
2
07-31-2015 11:26 AM
marwamohamed
New Contributor

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);

            }

        }

0 Kudos
2 Replies
seria
by Esri Contributor
Esri Contributor

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

ApurvDanke
Occasional Contributor

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.

System.Runtime.InteropServices.COMException was caught
  HelpLink=esri_csGeoDatabase.hlp
  HResult=-2147216072
  Message=Underlying DBMS error [ORA-29902: error in executing ODCIIndexStart() routine
ORA-13200: internal error [ODCIIndexStart] in spatial indexing.
ORA-13033: Invalid data in the SDO_ELEM_INFO_ARRAY in SDO_GEOMETRY object
ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 543::SELECT  TOID,  VERSION,  VERDATE,  FEATCODE,  THEME,  CALCAREA,  CHANGE,  DESCGROUP,  DESCTERM,  MAKE,  PHYSLEVEL,  PHYSPRES,  BROKEN,  LOADDATE,  OBJECTID,  SHAPE,  SE_ANNO_CAD_DATA,  0,  0   FROM  OSMM.OSMMAREA WHERE mdsys.sdo_filter(OSMM.OSMMAREA.SHAPE, MDSYS.SDO_GEOMETRY(:gtype1,:srid1,NULL,:elem_info1,:ordinates1), 'querytype=window') = 'TRUE' AND  (FEATCODE IN (10089,10167,10172,10183))] [OSMM.OSMMArea]
  Source=esriDataSourcesGDB.SdeWorkspace.1
  ErrorCode=-2147216072
  StackTrace:
       at ESRI.ArcGIS.Geodatabase.IFeatureClass.Search(IQueryFilter filter, Boolean Recycling)
       at CrossingsUpdate.PipeCrossingPoint.GetOSMMGeometry(IFeature pFeederFeature, IFeatureClass pOsmmFC, String osmm_FeatCodeList)
The Feature Class I am trying to do a spatial query on is "pOsmmFC" which is a polygon type, while the query geometry is from another Feature Class which is a Polyline type. The "pOsmmFC" contains around 8 million features, but I am only interested in 4 feature codes, which are applied in the where clause of the spatial filter.
I also tried Select By Location in ArcMap using the same two feature classes and selected the same polyline feature on the map, and tried do perform spatial query on the OSMM polygon feature class using only the selected feature, and it gave the output showing 257 intersecting features. Why isn't the same working in ArcObjects?
The ArcGIS version is 10.4.1 on Oracle database 12c. We are using SDO Geometry as the geometry type for geodatabase.
Regards,
Apurv
0 Kudos