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

533
3
10-30-2013 08:05 PM
brucesimonson
New Contributor III
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
0 Kudos
3 Replies
larryzhang1
New Contributor III
... 

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 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? 
... 



Bruce,

If I understand your case correctly (below), the solution should go with mosaic operation in raster imagery literature, rather than combination /merging.


[INDENT]In AOI, there are two 4-band images spatially apart (one is located in NE; and another in SW). What you want is to â??combineâ?? those two 4-band images into one 4-band image. Concerns on nodata during 'combination'. [/INDENT]

For example, just simply use MD model in ArcGIS (and then export from MD into IMG, when needed), no matter if two images have overlapping areas and same depth; or mosaic two via GP tool called â??Mosaic To New Rasterâ??, if have same depth and no overlapping between two images (here, it is better to use image extension in IMG). In fact, not need concern any nodata in raster images like 8-bit or 11/16-bit.

Note, data cells (0,0,0,0) is not equalling to nodata. In fact, it is easy to automatically transform data cells (0,0,0,0) as 'BLACK' edge into 1 or any other digial number via Histogram adjustment. Besides, it is better to have same depth (in 8-bit, if different), before mosaic

Regards,
0 Kudos
JeffreySwain
Esri Regular Contributor
I think I am following the description.  You have 4 individual rasters with each representing a particular band. It seems you have processed the bands to remove the NoData and now want to combine them?  If that is the case, then use the Composite Bands tool. It will create a single raster with 4 bands.  Hopefully the NoData issue will be resolved by your attempt, but at worse will need to be handled at this point.
0 Kudos
larryzhang1
New Contributor III
I think I am following the description.  You have 4 individual rasters with each representing a particular band. It seems you have processed the bands to remove the NoData and now want to combine them?  If that is the case, then use the Composite Bands tool. It will create a single raster with 4 bands.  Hopefully the NoData issue will be resolved by your attempt, but at worse will need to be handled at this point.


Jeff,

Frankly, I didn�??t try the GP tool (Composite Bands in ArcGIS) before, but fully believe that it will create one 8-band image from two 4-band images.

On nodata, it can be configured with transparancy, which has no need to worry during any raster operations...
0 Kudos