Rescale (Data Management)

Summary

Resizes a raster by the specified x and y scale factors.

Usage

Syntax

Rescale_management (in_raster, out_raster, x_scale, y_scale)
ParameterExplanationData Type
in_raster

The input raster dataset.

Raster Layer
out_raster

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 file
  • .jpg—JPEG
  • .jp2—JPEG 2000
  • .png—PNG
  • .tif—TIFF
  • no extension—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
x_scale

The factor in which to scale the cell size in the x direction.

The factor must be greater than zero.

Double
y_scale

The factor in which to scale the cell size in the y direction.

The factor must be greater than zero.

Double

Code Sample

Rescale example 1 (Python window)

This is a Python sample for the Rescale tool.

import arcpy
arcpy.Rescale_management("c:/data/image.tif", "c:/output/rescale.tif", "4", "4")
Rescale example 2 (stand-alone window)

This is a Python script sample for the Rescale tool.

##====================================
##Rescale
##Usage: Usage: Rescale_management in_raster out_raster x_scale y_scale
    
try:
    import arcpy
    
    arcpy.env.workspace = r"C:/Workspace"
    
    ##Rescael a TIFF image by a factor of 4 in both directions
    arcpy.Rescale_management("image.tif", "rescale.tif", "4", "4")
    
except:
    print "Rescale example failed."
    print arcpy.GetMessages()

Environments

Related Topics

Licensing Information

ArcView: Yes
ArcEditor: Yes
ArcInfo: Yes

10/27/2014