Select to view content in your preferred language

Automation Exception from FeatureIndex

2959
3
11-03-2014 02:01 PM
StevenHirsch
Deactivated User

I have a Java application that uses ArcGIS RT 10.1.  One feature class in my data set consists of polygons and several of lines.  I have built an index over the polygon class and am calling FeatureIndex.nearestFeature() on each line to see which polygon is closest.  This works for some of the line classes, but one of them causes an immediate AutomationException from 'nearestFeature'.  I am guarding against null shapes and empty shapes and cannot figure why this one class is causing issues.

I would appreciate any suggestions or guesses as to why this happens only on one input class.

0 Kudos
3 Replies
EricBader
Honored Contributor

Interesting.

Is your data set from a local data source, like from a map package? Or is it from a Feature Service?

0 Kudos
StevenHirsch
Deactivated User

Thanks for the reply, Eric!  It was from a local GDB.  After a lot of hair pulling, it turns out that nearestFeature() does not gracefully handle situations where the passed geometry is in a different coordinate system (shame on me) OR is projected correctly but through a data entry error resides at a very large distance from anything in the index (a bug or a feature?).  I really, really wish that AutomationExceptions provided some diagnostic detail - or do they and perhaps I'm just not getting at them properly?

Always more to learn, and thanks again.

0 Kudos
EricBader
Honored Contributor

Steven, I couldn't agree more. An AutomationException without a meaningful message is one of the most frustrating experiences a developer can encounter. We need to continue being vigilant and reactive to feedback like this. Thanks.

0 Kudos