com.esri.arcgis.datasourcesraster
Interface IRasterBandCollection

All Superinterfaces:
Serializable
All Known Implementing Classes:
FunctionRasterDataset, Raster, RasterDataset, RenderedRaster

public interface IRasterBandCollection
extends Serializable

Provides access to members that control a collection of RasterBands.

Remarks

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.

When To Use

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

Product Availability

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


Method Summary
 void add(IRasterBand element, int index)
          Adds a RasterBand to the band collection.
 void appendBand(IRasterBand element)
          Appends a RasterBand to the band collection.
 void appendBands(IRasterBandCollection bands)
          Appends a collection of RasterBands to the band collection.
 void clear()
          Removes all the elements in the collection.
 IRasterBand getBandByName(String name)
          A RasterBand given its name.
 int getBandIndex(String name)
          The index of a RasterBand given its name.
 IEnumRasterBand getBands()
          All the bands in the collection as an interface to the RasterBands enumerator object.
 int getCount()
          The number of bands in the collection.
 IRasterBand item(int bandIndex)
          Returns a RasterBand given its index.
 void remove(int index)
          Removes an element from the collection.
 IDataset saveAs(String new_name, IWorkspace worksp, String format)
          Creates a new persistent RasterDataset with the bands in the collection.
 

Method Detail

add

void add(IRasterBand element,
         int index)
         throws IOException,
                AutomationException
Adds a RasterBand to the band collection.

Remarks

This method is only applicable to work with a Raster, not with a RasterDataset.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
element - A reference to a com.esri.arcgis.datasourcesraster.IRasterBand (in)
index - The index (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCount

int getCount()
             throws IOException,
                    AutomationException
The number of bands in the collection.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

clear

void clear()
           throws IOException,
                  AutomationException
Removes all the elements in the collection.

Remarks

This method is only applicable to work with a Raster, not with a RasterDataset.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

remove

void remove(int index)
            throws IOException,
                   AutomationException
Removes an element from the collection.

Remarks

This method is only applicable to work with a Raster, not with a RasterDataset.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
index - The index (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getBandIndex

int getBandIndex(String name)
                 throws IOException,
                        AutomationException
The index of a RasterBand given its name.

Product Availability

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

Parameters:
name - The name (in)
Returns:
The bandIndex
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getBandByName

IRasterBand getBandByName(String name)
                          throws IOException,
                                 AutomationException
A RasterBand given its name.

Product Availability

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

Parameters:
name - The name (in)
Returns:
A reference to a com.esri.arcgis.datasourcesraster.IRasterBand
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getBands

IEnumRasterBand getBands()
                         throws IOException,
                                AutomationException
All the bands in the collection as an interface to the RasterBands enumerator object.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.datasourcesraster.IEnumRasterBand
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

item

IRasterBand item(int bandIndex)
                 throws IOException,
                        AutomationException
Returns a RasterBand given its index.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
bandIndex - The bandIndex (in)
Returns:
A reference to a com.esri.arcgis.datasourcesraster.IRasterBand
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

saveAs

IDataset saveAs(String new_name,
                IWorkspace worksp,
                String format)
                throws IOException,
                       AutomationException
Creates a new persistent RasterDataset with the bands in the collection.

Remarks

The SaveAs method can create a raster dataset in Imagine, TIFF, GRID, JPEG2000, JPEG, BMP, GIF, PNG, PCI Raster, USGS ASCII DEM, X11 Pixmap, Memory Raster and geodatabase raster.

The format strings used for the supported formats are below, and they are case sensitive:

Format Name String Used
Imagine "IMAGINE Image"
TIFF "TIFF"
GRID "GRID"
JPEG "JPG"
JP2000 "JP2"
BMP "BMP"
PNG "PNG"
GIF "GIF"
PCI Raster "PIX"
X11 Pixmap "XPM"
PCRaster "MAP"
Memory Raster "MEM"
HDF4 "HDF4"
BIL "BIL"
BIP "BIP"
BSQ "BSQ"
Idrisi Raster Format "RST"
ENVI Raster Format "ENVI"
Geodatabase Raster "GDB"

The format string "TIFF" creates a TIFF file with ".tif" extension. ArcGIS also supports TIFF format with ".tiff" and ".tff" extensions. A format string "TIF" creates a TIFF file with ".tiff" extention and a format string "TFF" creates a TIFF file with ".tff" extension.

Note, SaveAs will return a RasterDataset, to prevent from SaveAs holding the output, .NET ReleaseCOMObject needs to be called to release the referene to the output raster dataset:

System.Runtime.InteropServices.Marshal.ReleaseComObject(outRasterDS);

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
new_name - The new_name (in)
worksp - A reference to a com.esri.arcgis.geodatabase.IWorkspace (in)
format - The format (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IDataset
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

appendBand

void appendBand(IRasterBand element)
                throws IOException,
                       AutomationException
Appends a RasterBand to the band collection.

Remarks

This method is only applicable to work with a Raster, not with a RasterDataset.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
element - A reference to a com.esri.arcgis.datasourcesraster.IRasterBand (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

appendBands

void appendBands(IRasterBandCollection bands)
                 throws IOException,
                        AutomationException
Appends a collection of RasterBands to the band collection.

Remarks

This method is only applicable to work with a Raster, not with a RasterDataset.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
bands - A reference to a com.esri.arcgis.datasourcesraster.IRasterBandCollection (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.