1

I'm trying to use the Intersect tool in ArcObjects SDK Java with two feature classes.

Here is my code:

 public void intersectTwoFeatureClasses(Object in1, Object in2, Object out) throws UnknownHostException, IOException {
 IGpValueTableObject intersectInFeatures = new GpValueTableObject();
 intersectInFeatures.setColumns(2);
 intersectInFeatures.setValue(0, 0, in1);
 intersectInFeatures.setValue(0, 1, 1);
 intersectInFeatures.setValue(1, 0, in2);
 intersectInFeatures.setValue(1, 1, 1);
 Intersect intersect = new Intersect(intersectInFeatures, out);
 IGeoProcessorResult result = gp.execute(intersect, null);
 if(result.getStatus() != esriJobStatus.esriJobSucceeded)
 return;
}

But I get an Automation Exception: Item Not Found in this Collection. in 'DAO.Fields'.

The way I create my IGPValueTableObject seems to be wrong.

Does anyone know how to create it for two feature classes ?

asked Mar 26, 2014 at 10:20
1
  • Have a look at this page, it shows an alternate method for populating the ValueTable. Commented Mar 26, 2014 at 13:13

1 Answer 1

3

Here is a working and simpler solution I found:

Intersect intersect = new Intersect(in1 + ";" + in2, out);

where in1 , in2 and out are strings giving the full path of input and output is a IFeatureClass

answered Oct 30, 2014 at 10:07

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.