<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Even,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span id="" title="" class="">Thank you</span> for your reply.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
You are right: ds = gdal.GetDriverByName('GTiff').Create( ) is under 4GB.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
It was the next command pushes GTiff over 4GB:</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
  ds.BuildOverviews('AVERAGE_MAGPHASE', [2,4,8,16]) </div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Is there a way to specify BIGTIFF in ds.<span style="background-color:rgb(255, 255, 255);display:inline !important">BuildOverviews() ?</span></div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Even Rouault <even.rouault@spatialys.com><br>
<b>Sent:</b> April 20, 2021 3:56 PM<br>
<b>To:</b> ni hao <ni_hao88@hotmail.com>; gdal-dev@lists.osgeo.org <gdal-dev@lists.osgeo.org><br>
<b>Subject:</b> Re: [gdal-dev] Python create BigTIFF image</font>
<div> </div>
</div>
<div>
<p><br>
</p>
<div class="x_moz-cite-prefix">Le 20/04/2021 à 20:53, ni hao a écrit :<br>
</div>
<blockquote type="cite">
<div>Hi list,</div>
<div><br>
</div>
<div>I use Python to create GeoTiff image, and I get the error because it exceeds 4GB.</div>
<div>ds = gdal.GetDriverByName('GTiff').Create(output_magnitude, xsize, ysize, 1, gdal.GDT_Float32)<br>
</div>
<div><br>
</div>
<div><span><span><span>   ERROR 1: TIFFReadDirectory:Failed to read directory at offset 4294957836</span></span></span><br>
<span><span><span>   ERROR 1: TIFFWriteDirectoryTagData:Maximum TIFF file size exceeded. Use BIGTIFF=YES creation option.</span></span></span><br>
</div>
<div><br>
</div>
<div>I need to turn on <strong>BIGTIFF=YES</strong></div>
<div><a href="https://gdal.org/drivers/raster/gtiff.html" id="LPlnk">https://gdal.org/drivers/raster/gtiff.html</a><br>
</div>
<div><br>
</div>
<div>But I don't do know how. I tried: </div>
<div><span>ds = gdal.GetDriverByName('GTiff').Create(output_magnitude, xsize, ysize, 1, gdal.GDT_Float32, BIGTIFF=YES)</span><br>
</div>
</blockquote>
<p><span>ds = gdal.GetDriverByName('GTiff').Create(output_magnitude, xsize, ysize, 1, gdal.GDT_Float32, options=['BIGTIFF=YES'])</span></p>
<p><span>But as you didn't specify compression, it should have done that automatically. Can you indicate the exact values of xsize and ysize you use ?<br>
</span></p>
<p><br>
</p>
<blockquote type="cite">
<div></div>
<div><span>but it didn't work.</span></div>
<div><span><br>
</span></div>
<br>
<fieldset class="x_mimeAttachmentHeader"></fieldset>
<pre class="x_moz-quote-pre">_______________________________________________
gdal-dev mailing list
<a class="x_moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="x_moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre class="x_moz-signature" cols="72">-- 
<a class="x_moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</div>
</body>
</html>