IFeatureCursor.Search(spatialFilter,...) has too much tolerance

Discussion created by Kaspatoo on Sep 7, 2011
Latest reply on Sep 8, 2011 by Kaspatoo

I have a couple of points and some line features. I know that every point lies exactly on one of the lines. For each point I now want to identify the underlying line.#
For this I use the Search Method of IFeatureCursor and a spatial Filter.

It works (not) fine.
Some often there are more than one "underlying" line found. But the lines never intersect or touch each other. So there seems to be some tolerance. I thought of the envelope but as I can see, the envelope is no area but a single point, isnt it?

Thanks for ideas and aswers!

Here the code:

IEnvelope envelope = point.Envelope;
                //envelope.Expand(1.1, 1.1, true);

                string shapeFieldName = contourClass.ShapeFieldName;

                // Create a new spatial filter and use the new envelope as the geometry    
                ISpatialFilter spatialFilter = new SpatialFilterClass();
                //spatialFilter.Geometry = envelope;
                spatialFilter.Geometry = point;
                spatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelEnvelopeIntersects;
                spatialFilter.set_OutputSpatialReference(shapeFieldName, point.SpatialReference);
                spatialFilter.GeometryField = shapeFieldName;

                // Do the search
                IFeatureCursor featureCursor = contourClass.Search(spatialFilter, false);