ckrath

How to perform spatial filter to get attributes?

Discussion created by ckrath on Jul 22, 2010
Latest reply on Jul 22, 2010 by ckrath
I am new to ArcObjects. Trying to make a method to get attributes from a feature by mouse click.
Any body, please help me to perform spatial query to get attributes of a feature.
My code is as below.

        public void getFeature(IActiveView activeView, int button, int shift, int X, int Y)
        {
            IMap map;
            IPoint ClickedPoint = activeView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y);
            if (activeView is IMap)
            {
                map = activeView.HitTestMap(ClickedPoint);
                if (map == null) return;
                IRubberBand rubberEnv = new RubberEnvelopeClass();

                IGeometry geom = rubberEnv.TrackNew(activeView.ScreenDisplay, null);
                IArea area = (IArea)geom;

                if (geom.IsEmpty == true)
                {
                    IEnvelope tempEnv = new EnvelopeClass();
                    tagRECT RECT = new tagRECT();
                    RECT.bottom = 0;
                    RECT.left = 0;
                    RECT.right = 5;
                    RECT.top = 5;

                    IDisplayTransformation dispTrans = activeView.ScreenDisplay.DisplayTransformation;
                    dispTrans.TransformRect(tempEnv, ref RECT, 4);
                    tempEnv.CenterAt(ClickedPoint);
                    geom = (IGeometry)tempEnv;
                }

                if (geom.IsEmpty == true) return;

                @ HERE I NEED SPATIAL FILTER @
               

            }

        }


Thanking you...

Outcomes