ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Data.Raster Namespace / RasterDataset Class / GetBand Method
Index of a band in this raster dataset.
Example

In This Topic
    GetBand Method (RasterDataset)
    In This Topic
    Gets a RasterBand from this raster dataset based on the band index. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Function GetBand( _
       ByVal index As Integer _
    ) As RasterBand
    public RasterBand GetBand( 
       int index
    )

    Parameters

    index
    Index of a band in this raster dataset.

    Return Value

    The RasterBand from this raster dataset based on the band index.
    Example
    Access the bands in a raster dataset
    {
      var count = rasterDataset.GetBandCount();
      RasterBand rasterBandByName = rasterDataset.GetBandByName(sBandName);
      var index = rasterDataset.GetBandIndex(sBandName);
    
      // Get a RasterBand from the raster dataset
      RasterBand rasterBand = rasterDataset.GetBand(0);
    
      // Get the RasterBandDefinition from the raster band.
      RasterBandDefinition rasterBandDefinition = rasterBand.GetDefinition();
      // Get the name of the raster band from the raster band.
      string bandName = rasterBandDefinition.GetName();
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also