Hello,<div><br></div><div> I am using an old version of the gdal library: 1.4.4.</div><div><br></div><div> I have include below the code I used to write the tiff image:</div><div><br></div><div><br></div><div> //-------------------------------------------------------------------------------------</div>
<div> </div><div> WriteImage(string aPath, int *myBuffer, int myNumLines, int myNumCols)</div><div> { </div><div><br></div><div><div> GDALRegister_GTiff();</div><div> GDALDataset *m_poDataset;</div><div> const char *pszFormat = "GTiff"; </div>
<div> GDALDriver *poDriver;</div><div><br></div><div> poDriver = GetGDALDriverManager()->GetDriverByName(pszFormat);</div></div><div><div> </div><div> if( poDriver == NULL ) return ( 0 );</div><div><br></div>
<div><br></div><div> char **papszOptions = NULL;</div></div><div><br></div><div><div> m_poDataset = poDriver->Create( aPath.c_str(), myNumColumns, myNumLines, 1, GDT_Byte,</div><div> papszOptions );</div>
<div><br></div><div><br></div><div> GDALRasterBand *poBand = m_poDataset->GetRasterBand(1);</div></div><div><br></div><div> poBand->RasterIO( GF_Write, 0, 0, myNumColumns, myNumLines,</div><div> myBuffer, myNumColumns, myNumLines, GDT_Int32, 0, 0 );</div>
<div><br></div><div><br></div><div> GDALClose(m_poDataset);</div><div><br></div><div> return 1;</div><div><br></div><div> }</div><div> </div><div><br></div><div> //-------------------------------------------------------------------------------------</div>
<div><br></div><div><br></div><div><br></div><div>Best Regards,</div><div><br></div><div>Jorge<br></div><br><div class="gmail_quote">2011/10/31 Brian Claywell <span dir="ltr"><<a href="mailto:bcclaywell@gmail.com">bcclaywell@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Jorge,<br>
<br>
On Mon, Oct 31, 2011 at 2:17 PM, Even Rouault<br>
<<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>> wrote:<br>
> Selon Jorge Martin <<a href="mailto:jormarfe@gmail.com">jormarfe@gmail.com</a>>:<br>
<div class="im">>> I am using RasterIO function to write tiff files. The problem<br>
>> appears when the image size is aprox. 25000x25000 (500Mb), the last lines<br>
>> of the image are not correctly written. The last lines are written with 0<br>
>> or 255 value. I have checked that if I only write a tiff file with the last<br>
>> lines of the image, this lines are correctly written.<br>
</div><snip><br>
<div class="im">> You didn't mention your GDAL version. If it is not a recent one, you could try<br>
> upgrading and see if it works better.<br>
<br>
</div>If you're seeing this behavior pre-1.8.1, it sounds similar to this<br>
bug, which has since been fixed:<br>
<a href="http://trac.osgeo.org/gdal/ticket/4090" target="_blank">http://trac.osgeo.org/gdal/ticket/4090</a><br>
<br>
-b<br>
<font color="#888888"><br>
--<br>
Brian Claywell<br>
<a href="mailto:bcclaywell@gmail.com">bcclaywell@gmail.com</a><br>
</font></blockquote></div><br>