Re:Re: [gdal-dev] write error

2010-04-11 Thread weixj2003ld
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

Re: [gdal-dev] write error

2010-04-11 Thread Even Rouault
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

[gdal-dev] write error

2010-04-10 Thread weixj2003ld
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 *

[gdal-dev] write error

2010-04-07 Thread weixj2003ld
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