Resample (Data Management)

License Level:BasicStandardAdvanced

Summary

Alters the raster dataset by changing the cell size and resampling method.

Usage

Syntax

Resample_management (in_raster, out_raster, {cell_size}, {resampling_type})
ParameterExplanationData Type
in_raster

The input raster dataset.

Mosaic Dataset; Mosaic Layer; Raster Dataset; Raster Layer
out_raster

The output raster dataset.

When storing the raster dataset in a file format, you need to specify the file extension:

  • .bil—Esri BIL
  • .bip—Esri BIP
  • .bmp—BMP
  • .bsq—Esri BSQ
  • .dat—ENVI DAT
  • .gif—GIF
  • .img—ERDAS IMAGINE
  • .jpg—JPEG
  • .jp2—JPEG 2000
  • .png—PNG
  • .tif—TIFF
  • no extension for Esri Grid

When storing a raster dataset in a geodatabase, no file extension should be added to the name of the raster dataset.

When storing your raster dataset to a JPEG file, a JPEG 2000 file, a TIFF file, or a geodatabase, you can specify a compression type and compression quality.

Raster Dataset
cell_size
(Optional)

The cell size for the new raster dataset.

You can specify the cell size in 3 different ways:

  • Using a single number specifying a square cell size
  • Using two numbers that specify the X and Y cell size, which is space delimited
  • Using the path of a raster dataset from which the square cell size will be imported

Cell Size XY
resampling_type
(Optional)

The resampling algorithm to be used. The default is NEAREST.

  • NEARESTNearest neighbor assignment
  • BILINEARBilinear interpolation
  • CUBICCubic convolution
  • MAJORITYMajority resampling
String

Code Sample

Resample example 1 (Python window)

This is a Python sample for the Resample tool.

import arcpy
arcpy.Resample_management("c:/data/image.tif", "resample.tif", "10 20", "NEAREST")
Resample example 2 (stand-alone script)

This is a Python script sample for the Resample tool.

# Resample TIFF image to a higher resolution

import arcpy
arcpy.env.workspace = r"C:/Workspace"
    
arcpy.Resample_management("image.tif", "resample.tif", "10", "CUBIC")

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Yes
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
5/7/2015