IDW (Spatial Analyst)

Summary

Interpolates a raster surface from points using an inverse distance weighted (IDW) technique.

Learn more about how IDW works

Usage

Syntax

Idw (in_point_features, z_field, {cell_size}, {power}, {search_radius}, {in_barrier_polyline_features})
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
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
power
(Optional)

The exponent of distance.

Controls the significance of surrounding points on the interpolated value. A higher power results in less influence from distant points. It can be any real number greater than 0, but the most reasonable results will be obtained using values from 0.5 to 3. The default is 2.

Double
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
in_barrier_polyline_features
(Optional)

Polyline features to be used as a break or limit in searching for the input sample points.

Feature Layer

Return Value

NameExplanationData Type
out_raster

The output interpolated surface raster.

Raster

Code Sample

IDW example 1 (Python window)

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

import arcpy
from arcpy import env  
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outIDW = Idw("ozone_pts.shp", "ozone", 2000, 2, RadiusVariable(10, 150000))
outIDW.save("C:/sapyexamples/output/idwout.tif")
IDW example 2 (stand-alone script)

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

# Name: IDW_Ex_02.py
# Description: Interpolate a series of point features onto a rectangular 
#   raster using Inverse Distance Weighting (IDW).
# 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
inPointFeatures = "ca_ozone_pts.shp"
zField = "ozone"
cellSize = 2000.0
power = 2
searchRadius = RadiusVariable(10, 150000)

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

# Execute IDW
outIDW = Idw(inPointFeatures, zField, cellSize, power, searchRadius)

# Save the output 
outIDW.save("C:/sapyexamples/output/idwout02")

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