Here is the code:

rasterKrig = "run{}_Krig_{}".format(counter, field)
outKrig = arcpy.sa.Kriging(Stations2010o3Data__2_, field, KrigingModelOrdinary, {2})
arcpy.env.extent = tempEnvironment0

I am getting a runback error:

KrigingModelOrdinary not defined in python

How and where do I define the KrigingModelOrdinary?


KrigingModelOrdinary is another function in the arcpy.sa module. If you want to use it as a variable, it needs to be defined earlier in your code. The Arc help page walks through the necessary inputs/usage; the following is a snippet based on their example.

# Create KrigingModelOrdinary Object
lagSize = 70000
majorRange = 250000
partialSill = 180000
nugget = 34000
kModelOrdinary = arcpy.sa.KrigingModelOrdinary("CIRCULAR", lagSize, majorRange,
                                               partialSill, nugget)

# Check out the ArcGIS Spatial Analyst extension license

# Execute Kriging
outKrigingOrd2 = arcpy.sa.Kriging(inPointFeature, "ELEVATION", kModelOrdinary, 2000,
                                  RadiusFixed(200000, 10), outVarRaster)
| improve this answer | |
  • line 53, in <module> File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\sa\Functions.py", line 2405, in Kriging out_variance_prediction_raster) File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\sa\Utils.py", line 47, in swapper result = wrapper(*args, **kwargs) File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\sa\Functions.py", line 2397, in wrapper out_variance_prediction_raster) File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\geoprocessing_base.py", line 484, in <lambda> return lambda *args: val(*gp_fixargs(args, True)) – user10720 Oct 8 '14 at 13:56
  • No idea. I've never used the function myself. Sorry :( – Erica Oct 8 '14 at 15:13
  • It has something to do with how I am saving my results from the Kriging, just not sure how to change it – user10720 Oct 8 '14 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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