Show Navigation | Hide Navigation
You are here:
Extensions > Spatial Analyst > Spatial Analyst functional reference > Interpolation (Spatial Analyst)

IDW

Release 9.3
Last modified September 7, 2011
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Interpolation (Spatial Analyst)"


Related Topics

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

Learn more about how IDW works


Usage tips

Command line syntax
An overview of the Command Line window
Idw_sa <in_point_features> <z_field> <out_raster> {cell_size} {power} {search_radius} {in_barrier_polyline_features}

Parameter Explanation Data Type
<in_point_features>

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

Composite Geodataset
<z_field>

Field that holds a height or magnitude value for each point. This can be a numeric field or the Shape field if the in_point_features contains z-values.

Field
<out_raster>

The output raster surface to be created.

Raster Dataset
{cell_size}

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}

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 zero, but the most reasonable results will be obtained using values from 0.5 to 3. The default is 2.

Double
{search_radius}

Defines which of the input points will be used to interpolate the value for each cell in the output raster.

There are two options: VARIABLE and FIXED. Variable is the default.

  • VARIABLE {number_of_points} {maximum_distance}
  • Uses a variable search radius in order to find a specified number of input sample points for the interpolation.
    • {number_of_points}  — An integer value specifying the number of nearest input sample points to be used to perform interpolation. The default is 12 points.
    • {maximum_distance}  — Specifies the distance, in map units, by which to limit the search for the nearest input sample points. The default value for maximum_distance is the length of the extent's diagonal.
  • FIXED {distance} {minimum_number_of_points}
  • Uses a specified fixed distance within which all input points will be used for the interpolation.
    • {distance}  — Specifies the distance as a radius within which input sample points will be used to perform the interplation.
    • The value of the radius is expressed in map units. The default radius is five times the cell size of the output raster.
    • {minimum_number_of_points}  — An integer defining the minimum number of points to be used for interpolation. The default value is zero (0).

Radius
{in_barrier_polyline_features}

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

Composite Geodataset
Data types for geoprocessing tool parameters


Command line example

Idw_sa c:/data/pts.shp spot final_1 1 2 "VARIABLE 12"

Scripting syntax
About getting started with writing geoprocessing scripts
Idw_sa (in_point_features, z_field, out_raster, cell_size, power, search_radius, in_barrier_polyline_features)

Parameter Explanation Data Type
in_point_features (Required)

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

Composite Geodataset
z_field (Required)

Field that holds a height or magnitude value for each point. This can be a numeric field or the Shape field if the in_point_features contains z-values.

Field
out_raster (Required)

The output raster surface to be created.

Raster Dataset
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 zero, but the most reasonable results will be obtained using values from 0.5 to 3. The default is 2.

Double
search_radius (Optional)

Defines which of the input points will be used to interpolate the value for each cell in the output raster.

There are two options: VARIABLE and FIXED. Variable is the default.

  • VARIABLE {number_of_points} {maximum_distance}
  • Uses a variable search radius in order to find a specified number of input sample points for the interpolation.
    • {number_of_points}  — An integer value specifying the number of nearest input sample points to be used to perform interpolation. The default is 12 points.
    • {maximum_distance}  — Specifies the distance, in map units, by which to limit the search for the nearest input sample points. The default value for maximum_distance is the length of the extent's diagonal.
  • FIXED {distance} {minimum_number_of_points}
  • Uses a specified fixed distance within which all input points will be used for the interpolation.
    • {distance}  — Specifies the distance as a radius within which input sample points will be used to perform the interplation.
    • The value of the radius is expressed in map units. The default radius is five times the cell size of the output raster.
    • {minimum_number_of_points}  — An integer defining the minimum number of points to be used for interpolation. The default value is zero (0).

Radius
in_barrier_polyline_features (Optional)

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

Composite Geodataset

Data types for geoprocessing tool parameters


Script example

# IDW_sample.py
# Description:
#   Interpolate a series of point features onto a rectangular 
#   raster using Inverse Distance Weighting (IDW).
# Requirements: None
# Author: ESRI
# Date: Sept 6, 2005
# Import system modules
import arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

try:
    # Set the output workspace name
    gp.Workspace = "c:/data"

    # Set the input feature dataset
    inputFeatureDataset = "c:/data/pts.shp"

    # Set the output raster name
    outputRaster = "final_1" 

    # Set some of the IDW parameters
    cell_size = 1
    IDW_power = 2
    IDW_neighborhood = "VARIABLE 12"
    Input_barrier_polyline_features = ""          # None

    # Set the output extent
    gp.Extent = "0 0 6 6"

    # Set the attribute field
    attributeName = "spot"

    # Check out Spatial Analyst extension license
    gp.CheckOutExtension("Spatial")

    # Process: IDW
    gp.Idw_sa(inputFeatureDataset, attributeName, outputRaster, cell_size, _ 
              IDW_power, IDW_neighborhood, Input_barrier_polyline_features)

except:
    # If an error occurred while running a tool, then print the messages
    print gp.GetMessages()

Map Algebra syntax
Idw(<point_feature | point_file>, {spot_item}, {barriers}, {power}, {SAMPLE, {num_points}, {max_radius}}, {cellsize}, {xmin, ymin, xmax, ymax})

Idw(<point_feature | point_file>, {spot_item}, {barriers}, {power}, {RADIUS, {radius}, {min_points}}, {cellsize},{xmin, ymin, xmax, ymax})

Parameter Explanation
<point_feature | point_file> The source of the data containing points with z-values to be converted to a raster surface.
  • point_feature  — A point shapefile or coverage with z-values stored in an item.
  • point_file  — An ASCII GENERATE file in the POINT format.
{spot_item} The item in the point shapefile or coverage to be used as the z-value for the interpolation.
The default is an item named SPOT. Use the # symbol as a placeholder when the point locations are input using a <point_file>. If the default SPOT item is not present, specify an alternative item.
{barriers} A shapefile or coverage containing arcs or an ASCII file of lines to be used as a break or limit in searching for the input sample points.
{power} Exponent of distance.
Controls the significance of surrounding points upon the interpolated value. A higher power results in less influence from distant points. It can be any real number greater than zero, but the most reasonable results will be obtained using values from 0.5 to 3. The default is 2.
SAMPLE Keyword indicating the method of searching for input points.
{num_points} An integer value specifying the number of nearest input sample points to be used to perform interpolation.
The default is 12 points.
{max_radius} Specifies the distance, in map units, by which to limit the search for the nearest input sample points.
If the number of points for the SAMPLE option cannot be satisfied within the {max_radius}, a smaller number of points will be used.
RADIUS Keyword indicating the method of searching for input points.
{radius} The distance, in map units, specifying that all input sample points within the specified radius will be used to perform interpolation.
The default radius is five times the cell size of the output raster.
{min_points} An integer value defining the minimum number of points to be used for interpolation.
If the required number of points is not found within the specified radius, the search radius will be increased until the specified minimum number of points is found. The default is zero.
{cellsize} The width or height of a cell in map units.
The cell size defaults to the current environment setting. If the cell size is not set, an error message will appear. In this case, specify the {cellsize} argument or use the Options dialog box to establish the current environment setting.
{xmin, ymin, xmax, ymax} The window in which to perform the interpolation.
Defaults to the current environment settings. If no environment is set, the default is the boundary of the input extended 0.5 times the cell size in each direction.

Map Algebra example

idw(pointcov)
idw(ptcover, depth, #, 1, sample, 10)
idw(pntfile, #, faultcov, #, radius, 500, 30)
idw(wellcover, flowrate, linefile, 3, sample, 20, #, 1.5, 34934, 89342, 35468, 93457)
idw(popdense, density, shores, #, radius, 30)	

ArcObjects syntax
IInterpolationOp::IDW (geoData As IGeoDataset, power As Double, radius as IRasterRadius, [barrier As Variant]) As IGeoDataset

Parameter Explanation
geoDataset A Featureclass or FeatureclassDescriptor containing point features with z-values to be interpolated to a raster surface.
power 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 zero but the most reasonable results will be obtained using values from 0.5 to 3. A commonly used power is 2.
radius An IRasterRadius indicating the search radius for the input points.
The radius distance is specified in map units within which all input sample points will be used to perform interpolation. A commonly used radius is five times the cell size of the output raster. The object will set and use whatever you set last in your VB script.
For example:

   set pRad.SetFixed 207.1

   set pRad.SetVariable 12
will use the args "... ,SAMPLE,12, ....", while:

   set pRad.SetVariable 12

   set pRad.SetFixed 207.1
will use the args "... ,RADIUS,207.1, ....".
[barrier] A shapefile containing arcs to be used as a break or limit in searching for the input sample points.

ArcObjects example

' Create the RasterInterpolationOp object
Dim pInterpolationOp As IInterpolationOp
Set pInterpolationOp = New RasterInterpolationOp

' Create the input point object
Dim pInputDataset As IGeoDataset

' Calls function to open the point dataset from disk
Set pInputDataset = OpenFeatureDataset("D:\SpatialData", "inputpoints")

' Define the search radius
Dim pRadius As IRasterRadius
Set pRadius = New RasterRadius
pRadius.SetVariable 12

' Create the output dataset object
Dim pOutputDataset As IGeoDataset

' Calls the method
Set pOutputDataset = pInterpolationOp.IDW(pInputDataset, 3, pRadius

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.