I found the error. I need the to call raster io like this. err = pBand->RasterIO(GF_Write,c_offset,r_offset,write_cols,write_rows,buffer,write _cols,write_rows,data_type,sizeof(T),cell_cols*sizeof(T)); Thanks Donald J