Shift (Data Management)

Summary

Moves (slides) the raster to a new geographic location based on x and y shift values. This tool is helpful if your raster dataset needs to be shifted to align with another data file.

Illustration

Shift illustration

Usage

  • The cell size of the output raster will be the same as that of the input raster.

  • The number of rows and columns in the output raster will be the same as those of the input raster, no matter what parameters are specified.

  • The coordinates of the lower left corner of the output raster will be offset from the input raster by the x and y shift coordinate values specified.

  • Using a negative shift x-coordinate value will shift the output to the left. A positive shift x-coordinate value will shift the output to the right. Using a negative shift y-coordinate value will shift the output down. A positive shift y-coordinate value will shift the output to the top.

  • The output raster dataset is nudged according to the location of the input snap raster, so the new shifted raster dataset can be aligned perfectly with another raster dataset.

  • This tool does not perform any resampling or warping.

  • You can save the output to BIL, BIP, BMP, BSQ, DAT, Esri Grid, GIF, IMG, JPEG, JPEG 2000, PNG, TIFF, MRF, or CRF format, or any geodatabase raster dataset.

  • When storing a raster dataset to a JPEG format file, a JPEG 2000 format file, or a geodatabase, you can specify a Compression Type value and a Compression Quality value in the geoprocessing environments.

Parameters

LabelExplanationData Type
Input Raster

The input raster dataset.

Mosaic Layer; Raster Layer
Output Raster Dataset

The output raster dataset.

When storing the raster dataset in a file format, specify the file extension as follows:

  • .bilEsri BIL
  • .bipEsri BIP
  • .bmp—BMP
  • .bsqEsri BSQ
  • .dat—ENVI DAT
  • .gif—GIF
  • .img—ERDAS IMAGINE
  • .jpg—JPEG
  • .jp2—JPEG 2000
  • .png—PNG
  • .tif—TIFF
  • .mrf—MRF
  • .crf—CRF
  • No extension for Esri Grid

When storing a raster dataset in a geodatabase, do not add a file extension to the name of the raster dataset.

When storing a raster dataset to a JPEG format file, a JPEG 2000 format file, a TIFF format file, or a geodatabase, you can specify Compression Type and Compression Quality values in the geoprocessing environments.

Raster Dataset
Shift X Coordinates by

The value used to shift the x-coordinates.

Double
Shift Y Coordinates by

The value used to shift the y-coordinates.

Double
Input Snap Raster
(Optional)

The raster dataset used to align the cells of the output raster dataset.

Raster Layer

arcpy.management.Shift(in_raster, out_raster, x_value, y_value, {in_snap_raster})
NameExplanationData Type
in_raster

The input raster dataset.

Mosaic Layer; Raster Layer
out_raster

The output raster dataset.

When storing the raster dataset in a file format, specify the file extension as follows:

  • .bilEsri BIL
  • .bipEsri BIP
  • .bmp—BMP
  • .bsqEsri BSQ
  • .dat—ENVI DAT
  • .gif—GIF
  • .img—ERDAS IMAGINE
  • .jpg—JPEG
  • .jp2—JPEG 2000
  • .png—PNG
  • .tif—TIFF
  • .mrf—MRF
  • .crf—CRF
  • No extension for Esri Grid

When storing a raster dataset in a geodatabase, do not add a file extension to the name of the raster dataset.

When storing a raster dataset to a JPEG format file, a JPEG 2000 format file, a TIFF format file, or a geodatabase, you can specify Compression Type and Compression Quality values in the geoprocessing environments.

Raster Dataset
x_value

The value used to shift the x-coordinates.

Double
y_value

The value used to shift the y-coordinates.

Double
in_snap_raster
(Optional)

The raster dataset used to align the cells of the output raster dataset.

Raster Layer

Code sample

Shift example 1 (Python window)

This is a Python sample for the Shift tool.

import arcpy
arcpy.Shift_management("c:/data/image.tif", "c:/output/shift.tif", "100",\
                       "150", "snap.tif")
Shift example 2 (stand-alone script)

This is a Python script sample for the Shift tool.

##====================================
##Shift
##Usage: Shift_management in_raster out_raster x_value y_value {in_snap_raster}
    
import arcpy

arcpy.env.workspace = r"C:/Workspace"

##Shift a TIFF image by 4.5 in X direction and 6 in Y direction
##Snap the output to a existing raster dataset
arcpy.Shift_management("image.tif", "shift.tif", "4.5", "6", "snap.tif")

Related topics