bruce.simonson

combining (merging?) 4-band imagery with areas of nodata

Discussion created by bruce.simonson on Oct 30, 2013
Latest reply on Nov 5, 2013 by hlzhang1022
Hi Gang,

I have two 8-bit 4-band (RGB+IR) raster files, that are the same size and dimension, that cover the same area.  The first has data in the extreme northeast corner, with no_data (0,0,0,0) everywhere else; the second has data in the extreme southwest corner, with no_data (0,0,0,0) everywhere else.

I'd like these to be combined in a single raster, of the same size, with all four bands - with non no_data from where it exists in each of the two rasters, and no_data set on the union of the non no_data cells. 

I think I got raster calculator to do this, but it only operated on the first band.  Here's the raster calculator command I picked up from a forum entry: 

Con(IsNull("raster1"),0,"raster1") + Con(IsNull("raster2"),0,"raster2")

I suppose I could try to run the calculator 4 times, one for each band (but I'm not exactly sure how to do that), and then try to figure out how to combine the four resulting rasters into a single 4-band raster (also, not sure how to do that).

Does it have to be this complicated?  Surely there's a way to take two multiple-banded rasters, with the same dimensions and characteristics, other than where the nodata reside, and create a new raster which combines the two?

Advice appreciated, thanks.
-Bruce

Outcomes