ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Data.Raster Namespace / RasterDatasetDefinition Class / GetBandCount Method
Example

In This Topic
    GetBandCount Method (RasterDatasetDefinition)
    In This Topic
    Gets the number of bands in the raster dataset. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public int GetBandCount()
    Public Function GetBandCount() As Integer

    Return Value

    An integer representing the number of bands in the raster dataset.
    Example
    Get the raster dataset definition from a raster dataset
    await QueuedTask.Run(() =>
    {
      RasterDatasetDefinition rasterDatasetDefinition = rasterDataset.GetDefinition();
    
      // access the dataset definition properties
      rasterDatasetDefinition.GetBandCount();
    });
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also