Check intersection with a feature class

438
3
08-24-2013 12:17 PM
NANA
by
New Contributor
I have an ArcObjects code that is checking whether a GeometryBag is intersecting with a list of feature classes (few tens of them) that are stored in SDE (everything is version 10.0).
It does this by opening a FeatureClass and then calling Search on it, and then calling NextFeature on the returned cursor, and returning true or false based on its result (the GeometryBag is small, so it won't intersect with a lot of features).

I'm seeing that the performance of this method isn't great, with OpenFeatureClass taking the most time. I wonder if it's reasonable that it's not fast, because OpenFeatureClass allows some advanced operations on the feature class after it's called, and whether there's a faster way of doing this in ArcObjects.

We have an ArcGis Server on our environment so I guess running Query against map services exposing the needed feature classes is also a reasonable option and may be faster.

Thanks.
0 Kudos
3 Replies
DuncanHornby
MVP Notable Contributor
I assume you are using the IFeatureWorkspace interface to open the FeatureClass? This is pretty much instant in my experience, which suggests the problem is at the ArcGIS Server end. I don't know much about ArcGIS server but why not try your code to open a FeatureClass from a local file GeoDatabase. If your code executes faster then this would suggest a network issue or a bottle neck at the server end. May be someone else can offer advice?
0 Kudos
NANA
by
New Contributor
The ArcGIS Server is not involved in this process, it just exists in our environment and is accessed by another application.
Yes, it is IFeatureWorkspace and it references the SDE. The OpenFeatureClass call isn't that slow but we're calling it for each of our tens of layers, and it accumulates to few tens of seconds.
So does a remote OpenFeatureClass should be instant as well?
0 Kudos
JohnStephens
Occasional Contributor
The ArcGIS Server is not involved in this process, it just exists in our environment and is accessed by another application.
Yes, it is IFeatureWorkspace and it references the SDE. The OpenFeatureClass call isn't that slow but we're calling it for each of our tens of layers, and it accumulates to few tens of seconds.
So does a remote OpenFeatureClass should be instant as well?


I run several processes that run through 50-60 feature classes and one of the fastest parts is opening the FCs.  I could probably loop through and open all of them in under 5 seconds.  I ran a process just earlier today that did that and deleted a field from each in 19 seconds.

Are you using a profiler to clock your code?  If not, how are you finding that's the slowest part?  I would think the intersections is what is eating up processing.  Maybe try opening more than one thread?
0 Kudos