How to georeference a raster using polynomial transformation

Given two sets of control points, this code example shows how to georeference a raster using polynomial transformation.

Georeferencing a raster using polynomial transformation

Using the following code example in your application:
static void georeferenceRaster(IRasterDataset2 rasterDataset, IPointCollection
    sourcePoints, IPointCollection targetPoints)throws Exception{
    // sourcePoints: represents source control points
    // targetPoints: represents target control points

    IRasterGeometryProc rasterPropc = new RasterGeometryProc();
    IRaster raster = rasterDataset.createDefaultRaster();

    //set the transformatin
    rasterPropc.warp(sourcePoints, targetPoints,
        esriGeoTransTypeEnum.esriGeoTransPolyOrder1, raster);

    //There are two ways to get the georeferenced result: to save the transformation with the input raster dataset

    //or save to another new raster dataset
    rasterPropc.rectify("c:/temp/georeferencing_output.img", "IMAGINE Image", raster)

Development licensingDeployment licensing
ArcGIS for Desktop AdvancedArcGIS for Desktop Advanced
ArcGIS for Desktop StandardArcGIS for Desktop Standard
ArcGIS for Desktop BasicArcGIS for Desktop Basic
Engine Developer KitEngine