[Gdal-dev] problem about "RasterIO"

qq myicqmail at 163.com
Mon Oct 9 09:26:35 EDT 2006

  I tried to read a .tif file with data type of "GDT_Byte" using the method of "RasterIO". It did well without problem. But When I tied to read a .tif file with data type of "GDT_Int32", it did't work.  My code is here:
if (RasterBand->GetRasterDataType() == GDT_Int32){
  LONG* pData;
  pData = (LONG*) CPLMalloc(sizeof(LONG)*nXSize*nYSize);
  RasterBand->RasterIO( GF_Read, 0, 0, nXSize, nYSize, pData, nXSize, nYSize,   GDT_Int32, 0, 0 );   
The pData is NULL. And the image data can't be read from the file. Would anyone tell what is the wrong? Thanks !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20061009/d3b58541/attachment.html

More information about the Gdal-dev mailing list