Select to view content in your preferred language

functions with multiband raster datasets

3947
4
05-08-2014 12:03 AM
Pieter-JanBaeck
Deactivated User
Hi

I have loaded several tiff files containing R, G and B bands. My first action was to resample these raster datasets, which resulted correctly in resampled raster datasets, each still containing R, G and B bands. Based on these multiband raster datasets, I now want to do some math functions, but it seems that these are performed on only one of the raster bands, and result in a single band raster. For instance, when I use Minus or Divide on two of these multiband raster datasets, I get a single band raster in return, whereas I would expect a resulting multiband raster where R(result) = R(1) / R(2), G(result) = G(1) / (G2) etc. More specifically, it seems that only the red bands (listed first) are considered and make up the resulting single band. The same goes for local statistics (for instance when calculating the mean of two multiband raster datasets).

- how can I perform spatial analyst functions on the multiband raster datasets and get multiband rasters as outcome, with the functions applied to each of the corresponding bands?
- alternatively, I could first split all the raster datasets into multiple single band rasters and work from there with the spatial analyst functions. But how do I split these bands or how do I batch load the individual bands of my original RGB tiffs?

Thanks for any help
0 Kudos
4 Replies
curtvprice
MVP Alum
- how can I perform spatial analyst functions on the multiband raster datasets and get multiband rasters as outcome, with the functions applied to each of the corresponding bands


You are correct -- if you are using the Spatial Analyst tools, you need to read each band ("image.tif/Band_1, image.tif/Band_2, etc), and then when you have your processed results, recombine them into a new multiband output using the Composite Bands tool.

See this help article on Raster Bands.
0 Kudos
Pieter-JanBaeck
Deactivated User
Hi Curtis,

thanks for the information - I suspected something like that. However, I don't find the link to information how to batch import the individual bands of multiple raster datasets in ArcCatalog. Using the normal import procedure automatically loads the raster datasets as composites, and double clicking the files in the browser when importing to get to the individual bands is not an option due to the amount of rasters I have to go through (hundreds). In other words, when I import all my multiband raster datasets in the normal way, I need to do the exact opposite of what "composite bands" does, but I cannot find how to do that. I do know the extract band function that I can apply on an imported multiband raster dataset, but I don't know how to make that work on multiple multiband raster datasets at once. Do you know if there is a way to batch run the extract band function?
0 Kudos
curtvprice
MVP Alum
Do you know if there is a way to batch run the extract band function?


If you use the CopyRaster tool and output to a single band format (grid), this will make a composite raster made of three grids.

arcpy.CopyRaster_management("test.jpg","d:\\users\\cprice\\work\\gtest")


creates three grids: gtestc1, gtestc2, gtestc3.  You could then use Iterate Rasters in Model Builder or ListRasters in Python using the wildcard gtestc* to process them one by one. I'm hoping someone else has a better idea...
0 Kudos
Pieter-JanBaeck
Deactivated User
Thanks, I'll try.

In the meantime, I've found some other ideas on another forum (see 2nd and 3rd reply using a calculator expression in a model), to be tested as well...
0 Kudos