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 catalogTo 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):
ESRI.ArcGIS.DataSourcesGDB ESRI.ArcGIS.DataSourcesRaster ESRI.ArcGIS.Geodatabase ESRI.ArcGIS.Geometry ESRI.ArcGIS.System (ESRI.ArcGIS.esriSystem)
Development licensing | Deployment licensing |
---|---|
ArcView | ArcView |
ArcEditor | ArcEditor |
ArcInfo | ArcInfo |
Engine Developer Kit | Engine Runtime |