Warp From File (Data Management)

License Level:BasicStandardAdvanced

Summary

Performs a transformation on the raster based on a link file, using a polynomial transformation. The link file contains the source and target control points.

Illustration

Example of two-dimensional coordinate transformations

Usage

Syntax

WarpFromFile_management (in_raster, out_raster, link_file, {transformation_type}, {resampling_type})
ParameterExplanationData Type
in_raster

The input raster dataset.

Mosaic Layer; 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
  • .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
link_file

The link file that will be used to warp the raster.

Each row in the input link file should have the following values, each delimited by a TAB:

  • <Optional ID> <From X> <From Y> <To X> <To Y>.

Text File
transformation_type
(Optional)

The geometric transformation type.

  • POLYORDER0A zero-order polynomial is used to shift your data. This is commonly used when your data is already georeferenced, but a small shift will better line up your data. Only one link is required to perform a zero-order polynomial shift.
  • POLYORDER1A first-order polynomial (affine) fits a flat plane to the input points. This is the default.
  • POLYORDER2A second-order polynomial fits a somewhat more complicated surface to the input points.
  • POLYORDER3A third-order polynomial fits a more complicated surface to the input points.
  • ADJUSTA transformation that optimizes for both global and local accuracy. It accomplishes this by first performing a polynomial transformation, then adjusting the control points locally, to better match the target control points, using a triangulated irregular network (TIN) interpolation technique.
  • SPLINEA transformation that exactly transforms the source control points to the target control points. This means that the control points will be accurate, but the raster pixels that are between the control points are not.
  • PROJECTIVEA transformation that can warp lines so they remain straight. In doing so, lines that were once parallel may no longer remain parallel. The projective transformation is especially useful for oblique imagery, scanned maps, and for some imagery products.
String
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

WarpFromFile example 1 (Python window)

This is a Python sample for the WarpFromFile tool.

import arcpy
arcpy.WarpFromFile_management(
     "\\cpu\data\raster.img", "\\cpu\data\warp_out.tif",
     "\\cpu\data\gcpfile.txt", "POLYORDER2", "BILINEAR")
WarpFromFile example 2 (stand-alone script)

This is a Python script sample for the WarpFromFile tool.

##Warp image with signiture file

import arcpy
arcpy.env.workspace = r"C:/Workspace"
    
    
arcpy.Warp_management("raster.img", "warp_output.tif", "gcpfile.txt", 
                      "POLYORDER2", "BILINEAR")

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Yes
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
11/18/2013