ESRI bug on performing a spatial query with a GeometryBag containing multiple shapes against SDE
This is an bug that I came up on when building some productivity tools for ArcMAP. It is interesting to note that this bug was introduced in ArcGIS 9.2 while ArcGIS 9.1 works fine. The bug took me by surprise since the bug happens in the core geometry functions of the ArcObjects library.
The feature I was building was performing a pretty simple spatial query operation using a SpatialFilter object on a featureclass. The featureclass against which the query was being performed was in a SDE database. Much to my chagrin, I came to find out that this bug occurs only when the featureclass is a SDE featureclass and not when it is from a file geodatabase. That doesn’t help too much cause our customers expect the application to work everywhere. Getting back to the SpatialFilter, the geometry being used in the filter was a GeometryBag containing more than one feature. On running the query, the results weren’t as expected. Even though, the GeometryBag contained more than one geometry in it, the results returned corresponded only to the first geometry in the GeometryBag. After, spending quite a bit of time figuring out all the cases when the error occurred I was able to contact ESRI support and confirm this as an issue and obtain an incident number.
#NIM010450 – SelectFeatures with a spatial query does not work when using a query geometry which is a GeometryBag with more than one feature in it.
Now, we just have to sit on our hands and wait patiently for ESRI to get around to fixing it. I was actually excited when ESRI had announced that they were making the effort to publish the list of known software defects online by August 2007. But this latest blog entry from the ESRI support center doesn’t sound too promising.