<BR>
<DIV>I use the following code to read data from a geotiff file and write it into a new one.the bands number is 6;</DIV>
<DIV>...</DIV>
<DIV>GDALDataset *poSrcDS,*poDstDS;//poSrcDs:the source file,poDstDS:the goal source </DIV>
<DIV>GDALRasterBand *poSrcBand,*poDstBand;//poSrcBand:the source band,poDstBand:the goal band</DIV>
<DIV>GDALDriver *poDstDriver;</DIV>
<DIV>double *m_AdGeoTransform=new double[6];</DIV>
<DIV>&nbsp;</DIV>
<DIV>...</DIV>
<DIV>poDstDriver=GetGDALDriverManager()-&gt;GetDriverByName(poSrcDS-&gt;GetDriver()-&gt;GetDescrition());</DIV>
<DIV>poDstDS=poDstDriver-&gt;create(DstFilename,nX,nY,6,GDT_Float32,NULL);</DIV>
<DIV>poSrcDS-&gt;GetGeoTransform(m_AdGeoTransform)</DIV>
<DIV>poDstDS-&gt;SetGeoTransform(m_AdGeoTransform);</DIV>
<DIV>poDstDS-&gt;SetProjection(poSrcDS-&gt;GetProjectionRef());</DIV>
<DIV>&nbsp;</DIV>
<DIV>for(int iBand=0;iBand&lt;6;iBand++)</DIV>
<DIV>{</DIV>
<DIV>&nbsp;&nbsp; poSrcBand=poSrcDS-&gt;GetRaserBand(iBand+1);</DIV>
<DIV>&nbsp; poDstBand=poDstDS-&gt;GetRaserBand(iBand+1);</DIV>
<DIV>&nbsp; float *pafScanline;</DIV>
<DIV>&nbsp; pafScanline=(float *)CPLMalloc(sizeof(float)*nX;</DIV>
<DIV>&nbsp;&nbsp;for(int i=1;i&lt;nY;i++)</DIV>
<DIV>&nbsp; {</DIV>
<DIV>&nbsp;&nbsp; &nbsp; poSrcBand-&gt;RasterIO(GF_Read,0,0,nX,i,pafScanline,nX,1,GDT_Float32,0,0);</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp; poDstBand-&gt;RasterIO(GF_Write,0,0,nX,i,pafScanline,nX,1,GDT_Float32,0,0);//If I comment this code,the program will be ok.</DIV>
<DIV>&nbsp;&nbsp;&nbsp;}</DIV>
<DIV>}</DIV>
<DIV>GDALClose((GDALDatasetH)poDstDS);</DIV>
<DIV>&nbsp;</DIV>
<DIV>When I run my program,CPU is very alway busy,and the program is blocked,why?</DIV><BR><BR><SPAN title="neteasefooter"></SPAN><br><br><span title="neteasefooter"/></span>