Replace band at provided index with new band.
- Parameters
-
raster | raster of band to be replaced |
band | : new band to add to raster |
index | : index of band to replace (0-based) |
- Returns
- NULL on error or replaced band
Definition at line 1498 of file rt_raster.c.
1501 assert(NULL !=
band);
1504 rterror(
"rt_raster_replace_band: Band does not match raster's dimensions: %dx%d band to %dx%d raster",
1509 if (index >=
raster->numBands || index < 0) {
1510 rterror(
"rt_raster_replace_band: Band index is not valid");
1515 RASTER_DEBUGF(3,
"rt_raster_replace_band: old band at %p", oldband);
void rterror(const char *fmt,...)
Wrappers used for reporting errors and info.
#define RASTER_DEBUGF(level, msg,...)
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
rt_band rt_raster_get_band(rt_raster raster, int n)
Return Nth band, or NULL if unavailable.
References ovdump::band, rt_band_t::raster, rtrowdump::raster, RASTER_DEBUGF, rt_raster_get_band(), and rterror().
Referenced by RASTER_reclass(), RASTER_setBandPath(), RASTER_setPixelValuesGeomval(), rt_raster_gdal_rasterize(), and test_raster_replace_band().