 This document is archived and information here might be outdated.  Recommended version.

Geodata transformations (ArcObjects .NET 10.8 SDK)
 ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > Developing with ArcGIS > Learning ArcObjects > Managing data > Working with image and raster data > Processing raster data > Geodata transformations

# Geodata transformations

Summary
This topic introduces geodata transforms and the framework implemented in ArcGIS, and explains how to extend the geodata transformation capability in ArcGIS by creating and adding a custom geodata transform.

### In this topic

Geodata transforms are mathematical algorithms that perform geometric transformation. Geodata transforms convert an image location (column and row) in a raster to a spatial reference coordinate (x, y, and possibly z) and vice versa. These calculations are used to determine which pixels to access and where to display them in a map frame.

### Affine transformation

The simplest and most commonly used transformation is an affine transformation, a special type of polynomial transformation that uses six coefficients to establish the origin and pixel sizes in each direction. World files are examples of an affine transformation. The following is an example of how an affine transformation is used to calculate (x,y) from (row, col):
Assume a tagged image file format (TIFF) image has a dimension of 10000 columns x 5000 rows in GCS_WGS84 (degrees) coordinates (parenthesis indicate the coefficient):
0.0359281435       (A1)
0.0000000000       (A2)
0.0000000000       (B1)
-0.0359281437      (B2)
-179.9820349282  (A0)
89.9820359281     (B0)
(A0, B0) represents the world coordinate at (0,0), the center of the upper left pixel. Other coefficients represent map units per pixel (degrees per pixel in this case).

### Forward transformation

The following is a formula of forward transformation:
x=A0 + A1 * column + A2 * row
y=B0 + B1 * column + B2 * row

### Inverse transformation

A transformation has both forward and inverse directions. For inverse transformation, assuming there is no rotation between the coordinate systems (for example, the two terms are zero), the inverse can be easily illustrated using the following equations:
column=(x - A0) / A1
row    =(y - B0) / B2
Or, rewritten to conform to the affine model:
column=(-A0)/A1 + (1/A1) * x   = 5000 + 27.7778 * (-176.38)=100
row     = (-B0)/B2 + (1/B2) * y    = 2500 + (-27.7778) * (82.78)=200
Notice that these inverse coefficients are very different than those in the world file:
27.7778      (A1)
0.0            (A2)
0.0            (B1)
-27.7778    (B2)
5000.0       (A0)
2500.0       (B0)
Now, (A0, B0) represents the pixel location at the map coordinate system origin (0,0). Other coefficients represent pixels per map unit (pixels per degree in this case).

### Geodata transformation and ArcGIS

ArcGIS supports many types of geodata transformations, from basic polynomial transformation to sensor models - such as RPC and frame cameras. These transformations are implemented as a set of GeodataXform classes, including PolynomialXform, AdjustXform, SplineXform, RPCXform, and FrameXform.
ArcGIS has an open framework to handle new geodata transformations. All GeodataXform classes implement a set of required interfaces - IGeodataXform, IClone, and IPersist - and interfaces to serialize them as persist streams.
You can also create a custom geodata transform in ArcGIS by implementing the required interfaces and substituting your own transformation algorithms. Because some of the underlying classes use particular data structures, it is not possible to use .NET languages to create a custom geodata transformation. Instead, VC++ must be used. For additional information, see the VC++ sample Create a custom geodata transform, available in the Visual C++ (VC++) software development kit (SDK).
Although this SDK focuses on C# and VB.NET development, it also contains resources for the VC++ developer. To access those resources, you need to select them as a part of your SDK installation. If you did not do so, you can modify your installation and select the VC++ option to get additional Help topics and samples.
Without the VC++ Appendix installed, the link to the Create a custom geodata transform sample fails.
Any GeodataXform, whether built-in or custom, can be saved within a raster dataset by using the IGeoDataSchemaEdit2 interface or applying the transformation to a Raster object using the IRaster2 interface.
A custom GeodataXform can be accessed and transformation triggered automatically in ArcGIS. If the GeodataXfom is stored in a format with a unique extension and is supported by an existing format driver in ArcGIS, a RasterXforms.dat file is needed in the ArcGIS bin directory to reference the file extension and the class ID of the custom GeodataXform. If the custom GeodataXform is associated with a new raster format, you must implement the ICustomXform interface for the ArcGIS software to recognize the custom GeodataXform when accessing the new format data and applying the transformation automatically. For more information, see the ArcGIS Image Management Resource Center code gallery.

To use the code in this topic, reference the following assemblies in your Visual Studio project. In the code files, you will need using (C#) or Imports (VB .NET) directives for the corresponding namespaces (given in parenthesis below if different from the assembly name):

Development licensing Deployment licensing
ArcGIS Desktop Basic ArcGIS Desktop Basic
ArcGIS Desktop Standard ArcGIS Desktop Standard