This sample shows how to create a table based raster catalog layer.
How to use
- Add this function to your project.
- Call this function from your code.
Public Function CreateTableBasedRasterCatalogLayer(pFeatureWs As IFeatureWorkspace, sName As String) As IRasterCatalogLayer
'pFeatureWs is the workspace where the table based raster catalog resides.
'sName is the name of the raster catalog
On Error GoTo erh
'Open the raster catalog as a regular table
Dim pTable As ITable
Set pTable = pFeatureWs.OpenTable(sName)
'Create raster catalog table
Dim pCatalogTable As IRasterCatalogTable
Set pCatalogTable = New RasterCatalogTable
Set pCatalogTable.Table = pTable
pCatalogTable.Update
'Create raster catalog layer
Dim pRasterCatalogLy As IRasterCatalogLayer
Set pRasterCatalogLy = New RasterCatalogLayer
pRasterCatalogLy.Create pCatalogTable
Set CreateTableBasedRasterCatalogLayer = pRasterCatalogLy
erh:
Set CreateTableBasedRasterCatalogLayer = Nothing
End Function