<DIV>Hi Warmerdam:</DIV>
<DIV> </DIV>
<DIV> The first file I tried to read is a .tif about 70M. Another file is a .img</DIV>
<DIV>file about 10M. Both those two files can be opend by ArcGIS software. But I failed to read them by GDAL. Are the parameters which i set in RasterIO wrong ?</DIV>
<DIV> </DIV>
<DIV>Best regards.</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV > </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #a0c6e5 2px solid; MARGIN-RIGHT: 0px">
<HR color=#a0c6e5 SIZE=1>
<BR>-----原始邮件-----<BR>发件人:"Frank Warmerdam" <WARMERDAM@POBOX.COM><BR>发送时间:2006-10-10 01:17:59<BR>收件人:"qq" <MYICQMAIL@163.COM><BR>抄送:gdal-dev@lists.maptools.org<BR>主题:Re: [Gdal-dev] problem about "RasterIO"<BR><BR><BR><PRE style="WIDTH: 100%; WORD-WRAP: break-word">qq wrote:
> HI:
>
> 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 !
QQ,
It sounds like the buffer allocation is failing because of a lack
of memory. Is your file large?
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | <A href="http://pobox.com/~warmerdam" target=_new>http://pobox.com/~warmerdam</A>
and watch the world go round - Rush | President OSGeo, <A href="http://osgeo.org/" target=_new>http://osgeo.org</A>
</PRE><!-- CoreMail Version 3.1.0 Copyright (c) 2002-2006 www.mailtech.cn --></BLOCKQUOTE><br><!-- footer --><br><br><br><br><br><div style="border-bottom:1px solid #999"></div><br>
        <font color="black" style="font-size:14.8px">美 女 恐 怖 败 家 秀 ( 组 图 ) </font>
        <br>
         <a href="http://adtaobao.allyes.com/main/adfclick?db=adtaobao&bid=600,597,58&cid=29985,198,1&sid=32501&show=ignore&url=http://www.taobao.com/vertical/lady/pro.php" target="_blank" style="font-size:13px;line-height:160%;color:blue">独 家 披 露 ! 小 资 女 人 8 个 绝 顶 隐 秘 的 趣 事 ( 组 图 )
</a>