Thk u for your answer.
1.I have change the following code:
for(int i=1;i<=nY;i++)
to
for(int i=0;iThe RasterIO parameters are not correct.
>
>Try instead :
> poSrcBand->RasterIO(GF_Read,0,i,nX,1,pafScanline,nX,1,GDT_Float32,0,0);
> poDstBand->RasterIO(GF_Write,0,i,nX,1,pafScanline,nX,1,GDT_Float32
The RasterIO parameters are not correct.
Try instead :
poSrcBand->RasterIO(GF_Read,0,i,nX,1,pafScanline,nX,1,GDT_Float32,0,0);
poDstBand->RasterIO(GF_Write,0,i,nX,1,pafScanline,nX,1,GDT_Float32,0,0);
The 'for(int i=1;i I use the following code to read data from a geotiff file and write it into
I use the following code to read data from a geotiff file and write it into a
new one.the bands number is 6;
...
GDALDataset *poSrcDS,*poDstDS;//poSrcDs:the source file,poDstDS:the goal source
GDALRasterBand *poSrcBand,*poDstBand;//poSrcBand:the source band,poDstBand:the
goal band
GDALDriver *
I use the following code to read data from a geotiff file and write it into a
new one.the bands number is 6;
...
GDALDataset *poSrcDS,*poDstDS;
GDALRasterBand *poSrcBand,*poDstBand;
GDALDriver *poDstDriver;
double *m_AdGeoTransform=new double[6];
...
poDstDriver=GetGDALDriverManager()->GetDriver