Rotate (Data Management)

Summary

Turns a raster dataset around the specified pivot point by the specified angle in degrees.

Specify a value between 0 and 360 degrees to rotate the raster by that amount in the clockwise direction. To rotate the raster in the counterclockwise direction, specify the angle as a negative value. The angle can be specified as an integer or a floating-point value.

Illustration

Rotate illustration

Usage

Syntax

Rotate_management (in_raster, out_raster, angle, {pivot_point}, {resampling_type})
ParameterExplanationData Type
in_raster

The input 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 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
angle

The angle in degrees to rotate the raster. This can be any floating-point number.

Double
pivot_point
(Optional)

The pivot point around which to rotate the raster. The default is the lower left corner of the input raster dataset.

Point
resampling_type
(Optional)

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

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

The NEAREST and MAJORITY options are used for categorical data, such as a land use classification. The NEAREST option is the default since it is the quickest and also because it will not change the cell values. Do not use NEAREST or MAJORITY for continuous data, such as elevation surfaces.

The BILINEAR option and the CUBIC option are most appropriate for continuous data. It is not recommended that BILINEAR or CUBIC be used with categorical data because the cell values may be altered.

String

Code Sample

Rotate example 1 (Python window)

This is a Python sample for the Rotate tool.

import arcpy
arcpy.Rotate_management("c:/data/image.tif", "c:/output/rotate.tif", "30",\
                        "1940000 304000", "BILINEAR")
Rotate example 2 (stand-alone window)

This is a Python script sample for the Rotate tool.

##====================================
##Rotate
##Usage: Rotate_management in_raster out_raster angle {pivot_point} {NEAREST | BILINEAR | CUBIC | MAJORITY}
    
try:
    import arcpy
    
    arcpy.env.workspace = r"C:/Workspace"
    pivot_point = "1942602 304176"
    
    ##Rescael a TIFF image by a factor of 4 in both directions
    arcpy.Rotate_management("image.tif", "rotate.tif", "30", pivot_point, "BILINEAR")
    
except:
    print "Rotate example failed."
    print arcpy.GetMessages()

Environments

Related Topics

Licensing Information

ArcView: Yes
ArcEditor: Yes
ArcInfo: Yes

10/27/2014