Помогите разобраться с программированием пространственного запроса.

Пробовал следующим образом.
По клику миши получаю координаты карты в point1 с помощью следующего кода
Код: Выделить всё
IMxDocument m_doc = m_application.Document as IMxDocument;
IActiveView pActiveView = m_doc.FocusMap as IActiveView;
IPoint point1 = pActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y);
Сделать это пытаюсь с помощью ISpatialFilter.
Вот пример кода, взял сдесь
Код: Выделить всё
IFeatureClass featureClass = (pLayer as IFeatureLayer).FeatureClass;
// Create the envelope and define its position.
IEnvelope envelope = new EnvelopeClass();
envelope.PutCoords( point1.X - 0.9, point1.Y - 0.9,point1.X + 0.9, point1.Y + 0.9 );
// Create the spatial filter and set its spatial constraints.
ISpatialFilter spatialFilter = new SpatialFilterClass();
spatialFilter.Geometry = envelope;
spatialFilter.GeometryField = featureClass.ShapeFieldName;
spatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelEnvelopeIntersects;
// Set the attribute constraints and subfields.
// We want to exclude ramps, highways and interstates.
spatialFilter.WhereClause = "Id = 0";
spatialFilter.SubFields = "Id";
// Execute the query.
IFeatureCursor featureCursor = featureClass.Search(spatialFilter, true);

Помогите плиз. Не знаю что делать.

Заранее спасибо за помощь