<div dir="auto">I don't think so. Bigtiff is a creation option, that defines the format of the file.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">ni hao <<a href="mailto:ni_hao88@hotmail.com">ni_hao88@hotmail.com</a>> schrieb am Di., 20. Apr. 2021, 21:37:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div 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="m_2566021327191376411" title="">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="m_2566021327191376411appendonsend"></div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<hr style="display:inline-block;width:98%">
<div id="m_2566021327191376411divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Even Rouault <<a href="mailto:even.rouault@spatialys.com" target="_blank" rel="noreferrer">even.rouault@spatialys.com</a>><br>
<b>Sent:</b> April 20, 2021 3:56 PM<br>
<b>To:</b> ni hao <<a href="mailto:ni_hao88@hotmail.com" target="_blank" rel="noreferrer">ni_hao88@hotmail.com</a>>; <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank" rel="noreferrer">gdal-dev@lists.osgeo.org</a> <<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank" rel="noreferrer">gdal-dev@lists.osgeo.org</a>><br>
<b>Subject:</b> Re: [gdal-dev] Python create BigTIFF image</font>
<div> </div>
</div>
<div>
<p><br>
</p>
<div>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="m_2566021327191376411LPlnk" target="_blank" rel="noreferrer">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></fieldset>
<pre>_______________________________________________
gdal-dev mailing list
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank" rel="noreferrer">gdal-dev@lists.osgeo.org</a>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank" rel="noreferrer">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre cols="72">--
<a href="http://www.spatialys.com" target="_blank" rel="noreferrer">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</div>
</div>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank" rel="noreferrer">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div>