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


How to persist a geodata transformation on a raster dataset (ArcObjects .NET 10.5 SDK)

How to persist a geodata transformation on a raster dataset


Summary
Some applications prohibit rasters from being permanently transformed; consequently, transformations can be stored in the raster dataset so that they can be retrieved and modified later.

Persisting a geodata transformation on a raster dataset

GeodataXform can be stored as part of a raster dataset and applied to transform pixels in the dataset on the fly during access. To add GeodataXform to a raster dataset, use the following code:
[C#]
public static void AddGeodataXformToRasterDataset(IRasterDataset rasterDataset,
    IGeodataXform xform)
{
    //Cast to the IGeoDatasetSchemaEdit2 interface.
    IGeoDatasetSchemaEdit2 datasetSchemaEdit=(IGeoDatasetSchemaEdit2)rasterDataset;

    // Add GeodataXform to the raster dataset.
    datasetSchemaEdit.AlterGeodataXform(xform);
}
[VB.NET]
Public Sub AddGeodataXformToRasterDataset(ByVal rasterDataset As IRasterDataset, ByVal xform As IGeodataXform)
    
    'Cast to the IGeoDatasetSchemeEdit2 interface.
    Dim datasetSchemaEdit As IGeoDatasetSchemaEdit2=CType(rasterDataset, IGeoDatasetSchemaEdit2)
    
    'Add GeodataXform to the raster dataset.
    datasetSchemaEdit.AlterGeodataXform(xform)
End Sub






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
ArcGIS Desktop Advanced ArcGIS Desktop Advanced
Engine Developer Kit Engine