Select to view content in your preferred language

Geoprocessor HRESULT problem

663
1
02-19-2013 09:37 AM
KevinYanuk
Deactivated User
Hello,

I am trying to run a "simple" Getis-Ord analysis on a feature class using the Geoprocessor object, and can't seem to figure out what the problem is.  I am getting the dreaded HRESULT E_FAIL error.  I also have dissolved buffer, and explode multi-part geoprocessor methods that run without problem.

public static void PerformGetisOrdAnalysis(this Geoprocessor gp, string inFeature, string field, string outFeature)
        {
            HotSpots getisOrd = new HotSpots();
            getisOrd.Input_Feature_Class = DatabaseUtils._scratchWorkspace.OpenFeatureClass(inFeature); // input feature class
            getisOrd.Input_Field = field;
            getisOrd.Output_Feature_Class = DatabaseUtils.FGDBPath + "\\" + outFeature; // location of output feature class
            getisOrd.Conceptualization_of_Spatial_Relationships = "INVERSE_DISTANCE";
            getisOrd.Distance_Method = "EUCLIDEAN_DISTANCE";
            getisOrd.Standardization = "NONE";
            getisOrd.Distance_Band_or_Threshold_Distance = 200;
            gp.Execute(getisOrd, null);
            if (gp.MessageCount > 0)
            {
                for (int Count = 0; Count <= gp.MessageCount - 1; Count++)
                {
                    FormHelper.SendMessage(gp.GetMessage(Count));
                }
            }
            FormHelper.PerformCurrentUpdate(10);
        }


Has anyone used this tool before with ArcObjects?  It just fails on Execute with no error.  I've tried many variations of the parameters, but it tells me nothing.
0 Kudos
1 Reply
KenBuja
MVP Esteemed Contributor
Have you tried running this manually in ArcMap by putting the string equivalents into the tool? Whenever I have problems with programming geoprocessing tools, I run them in ArcMap and examine the results to make sure I'm putting the correct inputs into the tool's properties.

Also, do you need the double slashes in the output feature class property?
0 Kudos