<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br class="webkit-block-placeholder"></div><div>Hi,</div><div><br class="webkit-block-placeholder"></div><div>I have been unable to write a 2400x2400, 7 band image using the geotiff driver and LZW in GDAL/Python. The code is below (using random ints just for testing), which dies with the message "bus error" immediately after printing "band 6". If I reduce the number of bands or the array dimensions then the error goes away. Likewise if I remove the compression. Maybe someone could tell me if this is expected, or if maybe what I'm doing just doesn't make sense? Thank you,</div><div><br class="webkit-block-placeholder"></div><div>Rob Braswell</div><div><br class="webkit-block-placeholder"></div><div><br></div><div><div><font class="Apple-style-span" face="Courier">from osgeo import gdal</font></div><div><font class="Apple-style-span" face="Courier">from osgeo.gdalconst import *</font></div><div><font class="Apple-style-span" face="Courier">import numpy</font></div><div><font class="Apple-style-span" face="Courier"><br class="webkit-block-placeholder"></font></div><div><font class="Apple-style-span" face="Courier">FORMAT = 'GTiff'</font></div><div><font class="Apple-style-span" face="Courier">DATATYPE = GDT_Int16</font></div><div><font class="Apple-style-span" face="Courier">OPTIONS = ['COMPRESS=LZW']</font></div><div><font class="Apple-style-span" face="Courier">outfile='foo.tif'</font></div><div><font class="Apple-style-span" face="Courier">xsize = 2400</font></div><div><font class="Apple-style-span" face="Courier">ysize = xsize</font></div><div><font class="Apple-style-span" face="Courier">nbands = 7</font></div><div><font class="Apple-style-span" face="Courier"><br class="webkit-block-placeholder"></font></div><div><font class="Apple-style-span" face="Courier">driver = gdal.GetDriverByName(FORMAT)</font></div><div><font class="Apple-style-span" face="Courier">f = driver.Create(outfile, xsize, ysize, nbands, DATATYPE, OPTIONS)</font></div><div><font class="Apple-style-span" face="Courier">for i in range(nbands):</font></div><div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="Courier">        </font></span><font class="Apple-style-span" face="Courier">x = numpy.random.randint(0,1000,(xsize,ysize))</font></div><div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="Courier">        </font></span><font class="Apple-style-span" face="Courier">print "band",i+1</font></div><div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="Courier">        </font></span><font class="Apple-style-span" face="Courier">o = f.GetRasterBand(i+1)</font></div><div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="Courier">        </font></span><font class="Apple-style-span" face="Courier">o.WriteArray(x)</font></div><div><font class="Apple-style-span" face="Courier"><br class="webkit-block-placeholder"></font></div><div><font class="Apple-style-span" face="Courier">f = None</font></div><div><br class="webkit-block-placeholder"></div></div></body></html>