<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> </DIV>
<DIV>...</DIV>
<DIV>poDstDriver=GetGDALDriverManager()->GetDriverByName(poSrcDS->GetDriver()->GetDescrition());</DIV>
<DIV>poDstDS=poDstDriver->create(DstFilename,nX,nY,6,GDT_Float32,NULL);</DIV>
<DIV>poSrcDS->GetGeoTransform(m_AdGeoTransform)</DIV>
<DIV>poDstDS->SetGeoTransform(m_AdGeoTransform);</DIV>
<DIV>poDstDS->SetProjection(poSrcDS->GetProjectionRef());</DIV>
<DIV> </DIV>
<DIV>for(int iBand=0;iBand<6;iBand++)</DIV>
<DIV>{</DIV>
<DIV> poSrcBand=poSrcDS->GetRaserBand(iBand+1);</DIV>
<DIV> poDstBand=poDstDS->GetRaserBand(iBand+1);</DIV>
<DIV> float *pafScanline;</DIV>
<DIV> pafScanline=(float *)CPLMalloc(sizeof(float)*nX;</DIV>
<DIV> for(int i=1;i<nY;i++)</DIV>
<DIV> {</DIV>
<DIV> poSrcBand->RasterIO(GF_Read,0,0,nX,i,pafScanline,nX,1,GDT_Float32,0,0);</DIV>
<DIV> poDstBand->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> }</DIV>
<DIV>}</DIV>
<DIV>GDALClose((GDALDatasetH)poDstDS);</DIV>
<DIV> </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>