0

In ArcMap , I have many interpolations to create and need a way of doing batch processing. I would like to use Universal Cokriging for interpolation. I have point features in a regular 0.25 arc deg grid with known values of a predicted precipitation variable. As a covariate, I have a high resolution raster map of a different precipitation variable.

For each map, I would like the Universal Cokriging model to have its own fitting/optimization of model parameters. The geostatistical wizard in the geostatistical analyst toolbar can do this for one map at time. Is there any way to run the geostatistical wizard in ArcPy so that optimized kriging parameters can be obtained programmatically?

Kriging Setup

Optimization Step

5
  • What do you mean by "map"? One ArcGIS project file? Apr 21, 2022 at 12:05
  • I just mean that the product I want is a collection of interpolations. I have a collection of hundreds of different point feature layers, and I need to create a "map" (Kriging interpolation) for each of them.
    – AF2k15
    Apr 21, 2022 at 16:20
  • if your not familiar with coding in Python I would recommend reading tutorials about the model builder. you would need to iterate over your collection and run geostatistical wizard Apr 21, 2022 at 17:51
  • Actually, I have more experience with ArcPy and would be starting from scratch learning model builder. I'm just not familiar with any ArcPy function to run Cokriging. I'll try learning model builder so I can at least see if it's possible to do this application.
    – AF2k15
    Apr 21, 2022 at 18:29
  • I am not familiar with this statistical methods - but maybe you will find information here: community.esri.com/t5/arcgis-geostatistical-analyst-questions/… Apr 22, 2022 at 16:27

1 Answer 1

0

Thanks to bloigge for pointing me in the right direction. The post linked in their comment explains how to manipulate the XML model template in order to optimize any new models created from the template. Change the beginning of line 2: from

<model name="Kriging">

to

<model name="Kriging" optimize="ByCrossvalidation">

An XML template can be saved in the last step of the wizard, and then I manually edited the template in a text editor. The output generated from the template is a geostatistical layer that is the same as if you had pressed the optimize button on steps 3 and 4 of the wizard. The template can be used for different input datasets and covariates as long as the number of input datasets is the same as was originally used to create the template.

import arcpy
import arcgisscripting

gdbFolder = r'C:\Users\me\Documents\ArcGIS\myFileGDB.gdb'
gp = arcgisscripting.create()
gp.workspace = gdbFolder
gp.CheckOutExtension( 'GeoStats' )

in_ga_model_source = r'C:\Users\me\Documents\ArcGIS\Cokriging.xml' #template with manually edited line 2
in_datasets = 'out_featureclass_Clip X=Shape Y=Shape F1=precip; SA_Terra_P' #out_featureclass_Clip is a shape file with a field called precip. SA_Terra_P is a covariate raster layer with a single band.
out_layer = 'GeostatisticalLyr1'

arcpy.GACreateGeostatisticalLayer_ga( in_ga_model_source=in_ga_model_source,
                                      in_datasets=in_datasets, 
                                      out_layer=out_layer )

The geostatistical layer can then be saved using the SaveToLayerFile tool or ArcPy function.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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