<div><font><font face="courier new,monospace">Ethan, you can fetch single bands using GDALRasterBand* poBand = GetRasterBand(1) and use poBand-&gt;RasterIO(...).  See docs here:<br clear="all"></font></font></div><div><font><font face="courier new,monospace"><br>

</font></font></div><div><font><font face="courier new,monospace"><a href="http://gdal.org/classGDALRasterBand.html">http://gdal.org/classGDALRasterBand.html</a><br></font></font></div><div><font><font face="courier new,monospace"><br>

</font></font></div><br><font face="courier new,monospace"><font>/**<br> *<br> * Kyle Shannon<br> * <a href="mailto:ksshannon@gmail.com" target="_blank">ksshannon@gmail.com</a><br> *<br> */</font></font><font><br></font><br>


<br><br><div class="gmail_quote">On Wed, Feb 8, 2012 at 08:39, Ethan <span dir="ltr">&lt;<a href="mailto:ethanfahy@gmail.com">ethanfahy@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

I am writing a C++ program that reads in 3 separate single band geotiffs,<br>
applies some math to them, then outputs a single geotiff files that contains<br>
the data from those 3 files in the bands 1,2 and 3.  I&#39;ve so far set up the<br>
code to follow the methods from the gdal api tutorial and have read in the<br>
values from each of the 3 geotiffs to 3 separate buffers.  When it comes<br>
time to use RasterIO to write to my single output geotiff, is there any way<br>
to write one band at a time?  Or is there any way to use the RasterIO<br>
function without first combining my 3 buffers into a single buffer?  For me<br>
the RasterIO documentation is a little unclear when it describes:<br>
        nBandCount      the number of bands being read or written.<br>
        panBandMap      the list of nBandCount band numbers being read/written. Note<br>
band numbers are 1 based. This may be NULL to select the first nBandCount<br>
bands.<br>
<br>
Thanks in advance for any help it&#39;s much appreciated.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.n6.nabble.com/Can-RasterIO-write-one-band-at-a-time-or-must-I-combine-my-separate-R-G-B-buffers-first-tp4376337p4376337.html" target="_blank">http://osgeo-org.1560.n6.nabble.com/Can-RasterIO-write-one-band-at-a-time-or-must-I-combine-my-separate-R-G-B-buffers-first-tp4376337p4376337.html</a><br>


Sent from the GDAL - Dev mailing list archive at Nabble.com.<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</font></span></blockquote></div><br>