Select to view content in your preferred language

Populate MakeValueArray() for Spatial Analyst Kriging

499
2
Jump to solution
09-07-2022 07:24 PM
JeromeHaaland
Regular Contributor

Is there any system for populating the parameters of a MakeValueArray()?

Below... the MakeValueArray() is populated correctly... except for the SemiVariogram properties.

protected override void OnClick()
        {
            var progDlg = new ProgressDialog("Running Geoprocessing Tool", "Cancel", 100, true);
            progDlg.Show();

            string inputPointFeatures = @"C:\Temp\Learn.gdb\points";
            string zValueField = "zField";
            string outputRaster = @"C:\Temp\Learn.gdb\output";
            string semiVariogram = "Ordinary Spherical 3 200 100 0";
            string outputCellSize = "1";
            string krigParameters = "Variable 4 150";
            string outputVariance = "";
            
            string tool = "C:\\Program Files\\ArcGIS\\Pro\\Resources\\ArcToolBox\\" +
                              "toolboxes\\Spatial Analyst Tools.tbx\\" + "Kriging";

            var parameters = Geoprocessing.MakeValueArray(inputPointFeatures, zValueField, 
                outputRaster, semiVariogram, outputCellSize, krigParameters, outputVariance);

            Geoprocessing.OpenToolDialog(tool, parameters);
            
            progDlg.Hide();
        }

 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
GKmieliauskas
Esri Regular Contributor

Hi,

Spherical already means Ordinary. Look here:

https://pro.arcgis.com/en/pro-app/latest/tool-reference/spatial-analyst/kriging.htm 

You can check all parameters starting that tool directly from ArcGIS Pro. After execution right click in history window and copy python script. It must be like this below:

out_surface_raster = arcpy.sa.Kriging(r"C:\Temp\Learn.gdb\points", "zField", "Spherical 3,000000 200,000000 100,000000 0,000000", 10, "VARIABLE 12", None); out_surface_raster.save(r"C:\Temp\Learn.gdb\output")

View solution in original post

2 Replies
GKmieliauskas
Esri Regular Contributor

Hi,

Spherical already means Ordinary. Look here:

https://pro.arcgis.com/en/pro-app/latest/tool-reference/spatial-analyst/kriging.htm 

You can check all parameters starting that tool directly from ArcGIS Pro. After execution right click in history window and copy python script. It must be like this below:

out_surface_raster = arcpy.sa.Kriging(r"C:\Temp\Learn.gdb\points", "zField", "Spherical 3,000000 200,000000 100,000000 0,000000", 10, "VARIABLE 12", None); out_surface_raster.save(r"C:\Temp\Learn.gdb\output")
JeromeHaaland
Regular Contributor

Thank You... That is exactly the system that I was looking for.  It works well.

0 Kudos