How to georeference a raster using polynomial transformation


Summary
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:
[Java]
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
    rasterPropc.register(raster);

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






Development licensing Deployment licensing
ArcGIS for Desktop Advanced ArcGIS for Desktop Advanced
ArcGIS for Desktop Standard ArcGIS for Desktop Standard
ArcGIS for Desktop Basic ArcGIS for Desktop Basic
Engine Developer Kit Engine