ArcGIS Pro 3.7 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 Function GetBandCount() As Integer
    public int GetBandCount()

    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 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also