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
Raster
required
The target raster.
Raster
required
The source raster.
Integer
default:"1"
The band index to copy from the source raster.
Integer
default:"at_end"
The index in the target raster to insert the band.
Return type
The resulting raster.

