ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Warp From File

  • Summary
  • Illustration
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Transforms a raster dataset using a file containing source and target control points.

Illustration

Example of two-dimensional coordinate transformations

Usage

  • Warp is useful when the raster requires a systematic geometric correction that can be modeled with a polynomial. A spatial transformation can invert or remove a distortion by using polynomial transformation of the proper order. The higher the order, the more complex the distortion that can be corrected. The higher orders of polynomial will involve progressively more processing time.

  • The default polynomial order (1) will perform an affine transformation.

  • To determine the minimum number of links necessary for a given order of polynomial, use the following formula:

    n = (p + 1) (p + 2) / 2

    where n is the minimum number of links required for a transformation of polynomial order p. It is strongly suggested to use more than the minimum number of links.

  • This tool will determine the extent of the warped raster and will set the number of rows and columns to be about the same as in the input raster. Some minor differences may be due to the changed proportion between the output raster's sizes in the x and y directions. The default cell size used will be computed by dividing the extent by the previously determined number of rows and columns. The value of the cell size will be used by the resampling algorithm.

    If you choose to define an output cell size in the Environment Settings, the number of rows and columns will be calculated as follows:

    columns = (xmax - xmin) / cell size
    rows = (ymax - ymin) / cell size

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

  • When storing your raster dataset to a JPEG file, a JPEG 2000 file, or a geodatabase, you can specify a Compression Type type and Compression Quality within the Environment Settings.

Syntax

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

The raster that you want to transform.

Mosaic Layer; Raster Layer
out_raster

The name, location and format for the dataset you are creating. When storing a raster dataset in a geodatabase, do not add a file extension 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 using environment settings.

  • .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
Raster Dataset
link_file

The file containing the coordinates to warp the input raster.

Text File
transformation_type
(Optional)

Select a method for shifting the raster dataset.

  • POLYORDER0 — Uses a zero-order polynomial 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.
  • POLYORDER1 —A first-order polynomial (affine) fits a flat plane to the input points.
  • POLYORDER2 —A second-order polynomial fits a somewhat more complicated surface to the input points.
  • POLYORDER3 —A third-order polynomial fits a more complicated surface to the input points.
  • ADJUST — Combines a polynomial transformation and uses a triangulated irregular network (TIN) interpolation technique to optimize for both global and local accuracy.
  • SPLINE — Transforms the source control points precisely to the target control points. In the output, the control points will be accurate, but the raster pixels between the control points are not.
  • PROJECTIVE — Warps 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)

Choose an appropriate technique based on the type of data you have.

  • NEAREST — The fastest resampling method; it minimizes changes to pixel values. Suitable for discrete data, such as land cover.
  • BILINEAR — Calculates the value of each pixel by averaging (weighted for distance) the values of the surrounding 4 pixels. Suitable for continuous data.
  • CUBIC — Calculates the value of each pixel by fitting a smooth curve based on the surrounding 16 pixels. Produces the smoothest image but can create values outside of the range found in the source data. Suitable for continuous data.
  • MAJORITY — Determines the value of each pixel based on the most popular value within a 3 by 3 window. Suitable for discrete data.

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 either of these 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 either of these 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

  • Compression
  • Current Workspace
  • Output CONFIG Keyword
  • Output Coordinate System
  • Extent
  • NoData
  • Pyramid
  • Raster Statistics
  • Scratch Workspace
  • Snap Raster
  • Tile Size

Licensing information

  • ArcGIS for Desktop Basic: Yes
  • ArcGIS for Desktop Standard: Yes
  • ArcGIS for Desktop Advanced: Yes

Related topics

  • An overview of the Projections and Transformations toolset
  • Fundamentals of georeferencing a raster dataset
  • Georeferencing toolbar tools
  • Georeferencing a raster to a vector
  • Entering specific x,y coordinates when georeferencing

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal