Kriging (Spatial Analyst)

Summary

Interpolates a raster surface from points using kriging.

Learn more about how Kriging works

Usage

Syntax

Kriging (in_point_features, z_field, semiVariogram_props, {cell_size}, {search_radius}, {out_variance_prediction_raster})
ParameterExplanationData Type
in_point_features

The input point features containing the z-values to be interpolated into a surface raster.

Feature Layer
z_field

The field that holds a height or magnitude value for each point.

This can be a numeric field or the Shape field if the input point features contain z-values.

Field
semiVariogram_props
kriging_model

The KrigingModel class defines which kriging model is to be used.

There are two types of kriging classes. The KrigingModelOrdinary method has five types of semivariograms available. The KrigingModelUniversal method has two types of semivariograms available.

  • KrigingModelOrdinary ({semivariogramType}, {lagSize}, {majorRange}, {partialSill}, {nugget})
    • semivariogramType—The semivariogram model to be used. The available models are:
      • SPHERICAL—Spherical semivariogram model. This is the default.
      • CIRCULAR—Circular semivariogram model.
      • EXPONENTIAL—Exponential semivariogram model.
      • GAUSSIAN—Gaussian (or normal distribution) semivariogram model.
      • LINEAR—Linear semivariogram model with a sill.
  • KrigingModelUniversal ({semivariogramType}, {lagSize}, {majorRange}, {partialSill}, {nugget})
    • semivariogramType —The semivariogram model to be used. The available models are:
      • LINEARDRIFT—Universal Kriging with linear drift.
      • QUADRATICDRIFT—Universal Kriging with quadratic drift.
  • After the {semivariogramType}, the other parameters are common between Ordinary and Universal kriging.
    • lagSize—The default is the output raster cell size.
    • majorRange—Represents a distance beyond which there is little or no correlation.
    • partialSill—The difference between the nugget and the sill.
    • nugget—Represents the error and variation at spatial scales too fine to detect. The nugget effect is seen as a discontinuity at the origin.
KrigingModel
cell_size
(Optional)

The cell size at which the output raster will be created.

This will be the value in the environment if it is explicitly set; otherwise, it is the shorter of the width or the height of the extent of the input point features, in the input spatial reference, divided by 250.

Analysis Cell Size
search_radius
(Optional)

The Radius class defines which of the input points will be used to interpolate the value for each cell in the output raster.

There are two types of radius classes: RadiusVariable and RadiusFixed. A Variable search radius is used to find a specified number of input sample points for the interpolation. The Fixed type uses a specified fixed distance within which all input points will be used for the interpolation. The Variable type is the default.

  • RadiusVariable ({numberofPoints}, {maxDistance})
    • {numberofPoints}—An integer value specifying the number of nearest input sample points to be used to perform interpolation. The default is 12 points.
    • {maxDistance}—Specifies the distance, in map units, by which to limit the search for the nearest input sample points. The default value is the length of the extent's diagonal.
  • RadiusFixed ({distance}, {minNumberofPoints})
    • {distance}—Specifies the distance as a radius within which input sample points will be used to perform the interpolation.

      The value of the radius is expressed in map units. The default radius is five times the cell size of the output raster.

    • {minNumberofPoints}—An integer defining the minimum number of points to be used for interpolation. The default value is 0.
Radius
out_variance_prediction_raster
(Optional)

Optional output raster where each cell contains the predicted semi-variance values for that location.

Raster Dataset

Return Value

NameExplanationData Type
out_surface_raster

The output interpolated surface raster.

Raster

Code Sample

Kriging example 1 (Python window)

This example inputs a point shapefile and interpolates the output surface as a GRID raster.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outKrig = Kriging("ozone_pts.shp", "OZONE", "Spherical", 2000, "Variable 12")
outKrig.save("c:/sapyexamples/output/krigout")
Kriging example 2 (stand-alone script)

This example inputs a point shapefile and interpolates the output surface as a GRID raster.

# Name: Kriging_Ex_02.py
# Description: Interpolates a surface from points using kriging.
# Requirements: Spatial Analyst Extension
# Author: ESRI
# Import system modules

import arcpy
from arcpy import env
from arcpy.sa import *

# Set environment settings
env.workspace = "C:/sapyexamples/data"

# Set local variables
inFeatures = "ca_ozone_pts.shp"
field = "OZONE"
cellSize = 2000
outVarRaster = "C:/sapyexamples/output/outvariance"
lagSize = 2000
majorRange = 2.6
partialSill = 542
nugget = 0

# Set complex variables
kModelOrdinary = KrigingModelOrdinary("CIRCULAR", lagSize,
                                majorRange, partialSill, nugget)
kRadius = RadiusFixed(20000, 1)



# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

# Execute Kriging
outKriging = Kriging(inFeatures, field, kModelOrdinary, cellSize,
                     kRadius, outVarRaster)

# Save the output 
outKriging.save("C:/sapyexamples/output/krigoutput02")

Environments

Related Topics

Licensing Information

ArcView: Requires Spatial Analyst or 3D Analyst
ArcEditor: Requires Spatial Analyst or 3D Analyst
ArcInfo: Requires Spatial Analyst or 3D Analyst

6/29/2011