ArcObjects Library Reference (DataSourcesRaster)  

IRasterBandCollection Interface

Provides access to members that control a collection of RasterBands.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

When To Use

The IRasterBandCollection interface allows you to access the raster bands that compose the raster.


Method Add Adds a RasterBand to the band collection.
Method AppendBand Appends a RasterBand to the band collection.
Method AppendBands Appends a collection of RasterBands to the band collection.
Read-only property BandByName A RasterBand given its name.
Read-only property BandIndex The index of a RasterBand given its name.
Read-only property Bands All the bands in the collection as an interface to the RasterBands enumerator object.
Method Clear Removes all the elements in the collection.
Read-only property Count The number of bands in the collection.
Method Item Returns a RasterBand given its index.
Method Remove Removes an element from the collection.
Method SaveAs Creates a new persistent RasterDataset with the bands in the collection.

CoClasses that implement IRasterBandCollection

CoClasses and Classes Description
FunctionRasterDataset A class for a function raster dataset.
Raster An in-memory representation of a dynamic raster that can perform resampling and reprojection.
RasterDataset A representation of a raster dataset on disk.
RenderedRaster (esriCarto) A raster that is rendered using a renderer.


IRasterBandCollection interface is used to manage and access a collection of raster bands of a RasterDataset or a Raster

The Add, Remove, Clear, AppendBand and AppenBands methods only applicable to IRasterBandCollection on a Raster, not on a RasterDataset.

When a band is added to or removed from a Raster object, the Raster recomputes a default cell size, extent, and spatial reference based on the bands in the Raster. If the user has not explicitly set these properties, the default settings will be applied to the raster object.

The spatial reference is determined first. If the user has not specified a spatial reference system to be applied to the raster, it is calculated from the first band in the raster that has a spatial reference other than unknown. If all bands have an unknown spatial reference, the spatial reference system of the raster will be unknown.

Next the cell size is calculated, if the cell size and number of rows and columns have not been specified by the user. The cell size is the maximum cell size of any input bands projected into the current spatial reference system. If no spatial reference system is known, the largest cell size of any band in the Raster is selected.

Finally, if the extent has not been specified by the user, it is calculated. The extent is the smallest bounding box with an integer number of rows and columns that can be placed around all bands of the input raster while aligning with the bottom-left corner of the Raster.


.NET Snippets

Create DistanceOp CostDistanceFull Cost Allocation Raster | Create LocalOp Combine Raster | Create DistanceOp CostDistanceFull Backlink Raster | Create DistanceOp EucDistanceFull Direction Raster | Create DistanceOp EucDistanceFull Allocation Raster | Create DistanceOp CostDistanceFull Least Accumulative Cost Raster | Create DistanceOp EucDistanceFull Distance Raster

.NET Samples

Create a custom default raster catalog renderer (Code Files: CustomRasterCatalogRenderer_VBNET) | Create a custom raster type from the ground up for DMCII data (Code Files: DMCIIRasterType) | Create a custom default raster renderer (Code Files: RasterRendererMaker_1bit_TIFF_VBNET)

.NET Related Topics

DataSourcesRaster | Geodatabase | Handling multiband output | How to access pixel data using a raster cursor | How to access pixel data using the RawBlocks object | How to add or remove a color map from a raster dataset | How to create a raster dataset | How to pan sharpen an image | How to save and load color maps | How to set raster properties when saving as a raster | Performing a spatial analysis operation using objects