How to create a geodatabase raster catalog layer


This sample shows how to create a geodatabase raster catalog layer.

How to use

  1. Add this function to your project.
  2. Call this function from your code.
[VBA]
Public Function CreateGeodatabaseRasterLayer(pRasterWsExt As IRasterWorkspaceEx, sName As String) As IGdbRasterCatalogLayer
    
    'pRasterWsExt represets the workspace where the raster catalog resides.
    'sName is the name of the raster catalog
    
    On Error GoTo erh
    
    'Open the raster catalog
    Dim pRasterCatalog As IRasterCatalog
    Set pRasterCatalog = pRasterWsExt.OpenRasterCatalog(sName)
    
    
    'Create the GdbRasterCatalogLayer
    Dim pGdbRasterCatalogLy As IGdbRasterCatalogLayer
    Set pGdbRasterCatalogLy = New GdbRasterCatalogLayer
    If Not pGdbRasterCatalogLy.Setup(pRasCatalog) = True Then Exit Function
    
    Set CreateGeodatabaseRasterLayer = pGdbRasterCatalogLy
erh:
    Set CreateGeodatabaseRasterLayer = Nothing
End Function