ArcMap add-in is freezing on .Search() by spatial filter. Here is my code, for ArcMap add-in 10.3 version. When I used it with Oracle databases, happens only on one instance, works perfectly with others. No error is thrown, it just waits there. Do you have any idea why this may be happening?

        IGeometry osakaGeometry = (IGeometry)point; //point - IPoint
        // Use the ITopologicalOperator interface to create a buffer.
        ITopologicalOperator topoOperator = (ITopologicalOperator)osakaGeometry;
        IGeometry buffer = topoOperator.Buffer(buffersize);

        List<IFeature> retVal = new List<IFeature>();
        ISpatialFilter spatialFilter = new SpatialFilterClass();
        spatialFilter.Geometry = buffer;//queryGeometry;
        spatialFilter.SpatialRel = reltype;//esriSpatialRelEnum.esriSpatialRelTouches;
        spatialFilter.SubFields = "*";
        spatialFilter.WhereClause = "1=1";

        foreach (IFeatureLayer fl in ToSelectLayers)
            IFeatureCursor fcursor = fl.FeatureClass.Search(spatialFilter, false);

... Not: I tried buffer size from 0.003 to 1. Apparently it is not the issue.

  • inpoint is IPoint, so I look for a features in ToSelectLayers located at %buffer% distance from inpoint. – shika-kun Nov 9 '17 at 12:44
  • Please use the edit button beneath your question to revise it with any requested clarifications. – PolyGeo Nov 9 '17 at 12:45
  • well, I think it is pretty clear, isn't it? – shika-kun Nov 9 '17 at 12:47
  • Corrected what I could. So don't agree. Actually the problem is defined in the header. Question is about details + text before code kinda gives an idea. – shika-kun Nov 9 '17 at 13:51
  • 1
    This might be too complex an issue; in SDE/PostGIS selections work fine up until a limit (not sure on numbers), simple selections can be performed but more complex selections stall if the connected username doesn't have a schema matching their username... Oracle may be different. Try exporting the table to file geodatabase, select from that and see if the selection is still failing, if it does not then it's most likely an Oracle tuning issue. – Michael Stimson Nov 11 '17 at 9:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.