Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I try to merge the some shapefiles into one by using ArcEngine java platform. But it seem like that parameters of my merge class is wrong ,i google it a long time and got nothing. Pls figure my problem out .The Error is :Invalid value type for parameter inputs.

public static  IGeoProcessorResult mergeTool(String shpPath,String[] shpNames,  String outFile) 
{  
    //Initialize the geoprocessorResult object
    //IGeoProcessorResult vGeoPR = null;
    // Initialize the geoprocessor.
    GeoProcessor vGeoP = null;
    IGeoProcessorResult vGeoPR = null;
    try {
        vGeoP = new GeoProcessor();
        IWorkspaceFactory vWSpaceFactory =new ShapefileWorkspaceFactory();
        //IFeatureClass vFeaCls = vFeatureWSpace.openFeatureClass(ShapeName);
       IWorkspace vWorkSpace; 
       IFeatureWorkspace vFeatureWSpace = null;
       vWorkSpace = vWSpaceFactory.openFromFile(shpPath, 0);
    vFeatureWSpace = (IFeatureWorkspace)vWorkSpace;
        IFeatureClass vFeaCls = null; 

        ArrayList<IFeatureClass> vInArray = new ArrayList<IFeatureClass>();
        for(int i=0;i<shpNames.length;i++)
        {

            vFeaCls= vFeatureWSpace.openFeatureClass(shpNames[i]);
            vInArray.add(vFeaCls);
        }
        //vGeoP.addMessage("I will overwrite your file if name exits!");
      // vGeoP.setEnvironmentValue("workSpace", vFeatureWSpace);
        vGeoP.setOverwriteOutput(true); 
         Merge  vMerge = new Merge(vInArray,outFile);
            vGeoPR=vGeoP.execute(vMerge,null);
            return vGeoPR;
share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

I found out one way to solve this problem.We should set the input parameter format like this:

 String inputString = inputDir1+";"+inputDir2;
           Merge  vMerge = new Merge(inputString ,outFile);
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.