trhart

Spatial Queries in ArcEngine (and ArcReader)

Discussion created by trhart on Jun 14, 2011
I'm executing a spatial query using the geometry of a polygon feature using the esriSpatialRelWithin spatial relation to find out what feature it is contained within in another polygon layer.

In ArcEngine I am getting 1 result and in ArcReaderControl I am getting 0 results - on the same map, same feature.

I then tried using esriSpatialRelIntersects and I get 4 results in both ArcReader and ArcEngine.  I take this to mean that my query geometry shares borders (because there are three other polygons that border the feature in the layer I am querying).  But if that is the case why is ArcEngine returning 1 result when I use esriSpatialRelWithin?  Shouldn't it return 0 results like the ArcReaderControl?

The next thing I tried was using eriSpatialRelRelation (in ArcEngine) and I set the relation description to TF**F**** which I took off this page (http://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/esriGeoDatabase/ISpatialFilter_SpatialRelDescription.htm) which is supposed to be the equivalent of esriSpatialRelWithin and it returns 0 results.

Can anyone provide some insight into this?

Outcomes