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


Accessing a raster dataset in a raster catalog (ArcObjects .NET 10.5 SDK)

Accessing a raster dataset in a raster catalog


Summary
This topic shows how to access a raster dataset in a raster catalog. The method is similar to accessing a feature in a feature class.

About accessing a raster dataset in a raster catalog

To access a raster dataset in a raster catalog, see the following code:
[C#]
Public IRasterDataset GetRasterCatalogItem(IRasterCatalog catalog, int oid)
{
    //OID is the ObjectID of the raster dataset in the raster catalog.
    IFeatureClass featureClass=(IFeatureClass)catalog;
    IRasterCatalogItem rasterCatalogItem=(IRasterCatalogItem)
        featureClass.GetFeature(oid);
    return rasterCatalogItem.RasterDataset;
}
[VB.NET]
Public Function GetRasterCatalogItem(ByVal catalog As IRasterCatalog, ByVal oid As Integer) As IRasterDataset
    'OID is the ObjectID of the raster dataset in the raster catalog.
    Dim featureClass As IFeatureClass=CType(catalog, IFeatureClass)
    Dim rasterCatalogItem As IRasterCatalogItem=CType(featureClass.GetFeature(oid), IRasterCatalogItem)
    Return rasterCatalogItem.RasterDataset
End Function


See Also:

How to access a raster catalog




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