How to define and generate overviews on a Mosaic dataset


Defining and generating overviews on a Mosaic dataset

The Mosaic dataset operation interface is used to perform operations on a Mosaic dataset. Do the following steps to define and generate overviews on a Mosaic dataset:
  1. Create a define overview parameters object.
  2. Use the IOverviewTileParameters interface to specify the overview factor used to generate overviews.
  3. Use the Mosaic dataset operation interface to define overviews.
  4. Create a generate overviews parameters object.
  5. Set properties to control overview generation.
  6. Use the Mosaic dataset operation interface to generate overviews.

    See the following code example:
[C#]
public void BuildOverviewsOnMD(IMosaicDataset theMosaicDataset)
{
    // The mosaic dataset operation interface is used to perform operations on 
    // a mosaic dataset.
    IMosaicDatasetOperation theMosaicDatasetOperation = (IMosaicDatasetOperation)
        (theMosaicDataset);

    // Create a define overview parameters object.
    IDefineOverviewsParameters defineOvArgs = new DefineOverviewsParametersClass();
    // Use the overview tile parameters interface to specify the overview factor
    // used to generate overviews.
    ((IOverviewTileParameters)defineOvArgs).OverviewFactor = 3;
    // Use the mosaic dataset operation interface to define overviews.
    theMosaicDatasetOperation.DefineOverviews(defineOvArgs, null);

    // Create a generate overviews parameters object.
    IGenerateOverviewsParameters genPars = new GenerateOverviewsParametersClass();
    // Set properties to control overview generation.
    IQueryFilter genQuery = new QueryFilterClass();
    ((ISelectionParameters)genPars).QueryFilter = genQuery;
    genPars.GenerateMissingImages = true;
    genPars.GenerateStaleImages = true;
    // Use the mosaic dataset operation interface to generate overviews.
    theMosaicDatasetOperation.GenerateOverviews(genPars, null);
}
[VB.NET]
Public Sub BuildOverviewsOnMD(ByVal theMosaicDataset As IMosaicDataset)
    ' The mosaic dataset operation interface is used to perform operations on
    ' a mosaic dataset.
    Dim theMosaicDatasetOperation As IMosaicDatasetOperation =
    DirectCast((theMosaicDataset), IMosaicDatasetOperation)
    
    ' Create a define overview parameters object.
    Dim defineOvArgs As IDefineOverviewsParameters = New DefineOverviewsParametersClass()
    ' Use the overview tile parameters interface to specify the overview factor
    ' used to generate overviews.
    Dim overviewTileParam As IOverviewTileParameters = defineOvArgs
    overviewTileParam.OverviewFactor = 3
    ' Use the mosaic dataset operation interface to define overviews.
    theMosaicDatasetOperation.DefineOverviews(defineOvArgs, Nothing)
    
    ' Create a generate overviews parameters object.
    Dim genPars As IGenerateOverviewsParameters = New GenerateOverviewsParametersClass()
    ' Set properties to control overview generation.
    Dim genQuery As IQueryFilter = New QueryFilterClass()
    Dim pSelParam As ISelectionParameters = genPars
    pSelParam.QueryFilter = genQuery
    genPars.GenerateMissingImages = True
    genPars.GenerateStaleImages = True
    ' Use the mosaic dataset operation interface to generate overviews.
    theMosaicDatasetOperation.GenerateOverviews(genPars, Nothing)
End Sub


See Also:

How to open a Mosaic dataset




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 for Desktop Standard ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced ArcGIS for Desktop Advanced