Select to view content in your preferred language

Converting 4-band raster to 3-band.  How?

5960
1
09-24-2013 09:32 AM
RobChasan
Regular Contributor
Using ArcMap 10.1/ C#/ ArcObjects

Within an add-in, the program is using the ExtractByMask Geoprocessor function to create tiffs from sde raster layers.  It works fine when working against 1 and 3 band rasters, but when a 4-band raster is used against it, it produces nothing.  Seems like the CompositeBands function should be suitable for converting the 4-band raster to 3-band, but I cannot figure out how to create the input raster for it.  Can someone provide a either a code snippet or a clue as to a good way to produce the 3-band input programmatically? Seems like I'm missing something simple...  Thanks.
0 Kudos
1 Reply
RobChasan
Regular Contributor
I can answer this question myself.

The problem wasn't with the ExtractByMask function, it was with the Geoprocessor Resample that was being done right afterwards.  (My mistake was in not catching the error properly.)  Once confirming that the extract was succeeding, it was fairly simple to use the CompositeBands function to use the 3-bands of interest from the extracted 4-bands and then feed the results of that to the Resample function. The results of the Resample function are as they should be.
0 Kudos