toRaster at a specified index toRasterIndex. The new band’s values are copied from fromRaster at a specified band index fromBand.
If no toRasterIndex is provided, the new band is appended to the end of toRaster. If no fromBand is specified, band 1 from fromRaster is copied by default.
IllegalArgumentException will be thrown in these cases:
- The provided Rasters,
toRaster&fromRasterdon’t have same shape. - The provided
fromBandis not infromRaster. - The provided
toRasterIndexis not in or at end oftoRaster.
Signatures
Parameters
The target raster.
The source raster.
The band index to copy from the source raster.
The index in the target raster to insert the band.
Return type
The resulting raster.

